Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_transition.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_transition.cpp	(revision 81)
@@ -79,4 +79,6 @@
 	      reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID = PORT_READ(in_PREDICT_BRANCH_UPDATE_PREDICTION_ID);
 
+#error "INSTRUCTION_ENABLE : ERROR implémentation, remplacer PC_PREVIOUS par PC_NEXT_NEXT"
+
 	      for (uint32_t i=0; i<_param->_nb_instruction; i++)
 		reg_PC_CURRENT_INSTRUCTION_ENABLE [i] = PORT_READ(in_PREDICT_INSTRUCTION_ENABLE [i]);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/Makefile	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/Makefile	(revision 81)
@@ -0,0 +1,24 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= ./
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ Library ]------------------------------------------
+LIBRARY				= $(DIR_LIB)/libPrediction_unit_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/Prediction_unit_Glue/Makefile.defs
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/Makefile.defs	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/Makefile.defs	(revision 81)
@@ -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/Prediction_unit_Glue/Makefile.deps
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/Makefile.deps	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/Makefile.deps	(revision 81)
@@ -0,0 +1,38 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+# DIR_MORPHEO must be defined
+
+Prediction_unit_Glue			= yes
+
+ifndef Behavioural
+include 			$(DIR_MORPHEO)/Behavioural/Makefile.deps
+endif
+
+#-----[ Directory ]----------------------------------------
+
+Prediction_unit_Glue_DIR			=	$(DIR_MORPHEO)/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue
+
+#-----[ Library ]------------------------------------------
+
+Prediction_unit_Glue_LIBRARY		= 	-lPrediction_unit_Glue	\
+					$(Behavioural_LIBRARY)	
+
+Prediction_unit_Glue_DIR_LIBRARY		=	-L$(Prediction_unit_Glue_DIR)/lib	\
+					$(Behavioural_DIR_LIBRARY)
+
+#-----[ Rules ]--------------------------------------------
+
+Prediction_unit_Glue_library		:
+				@\
+				$(MAKE) Behavioural_library;		\
+				$(MAKE) --directory=$(Prediction_unit_Glue_DIR) --makefile=Makefile;
+
+Prediction_unit_Glue_library_clean	:
+				@\
+				$(MAKE) Behavioural_library_clean;	\
+				$(MAKE) --directory=$(Prediction_unit_Glue_DIR) --makefile=Makefile clean;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/Makefile	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/Makefile	(revision 81)
@@ -0,0 +1,30 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= ../
+include				$(DIR_COMPONENT)/Makefile.defs
+
+LIBRARY				= $(Prediction_unit_Glue_LIBRARY)
+
+DIR_LIBRARY			= $(Prediction_unit_Glue_DIR_LIBRARY)
+
+#-----[ include ]------------------------------------------
+
+all				:
+				@$(MAKE) all_selftest
+
+library				: Prediction_unit_Glue_library
+
+library_clean			: Prediction_unit_Glue_library_clean
+
+include                         $(DIR_COMPONENT)/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/Prediction_unit_Glue/SelfTest/config_mono_context.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/config_mono_context.cfg	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/config_mono_context.cfg	(revision 81)
@@ -0,0 +1,8 @@
+Prediction_unit_Glue
+1	1	+1	# nb_context     
+30	30	+32	# size_address   
+1	4	*4	# nb_instruction  [0] [nb_context]
+1	4	*4	# size_depth      [0] [nb_context]
+1	1	*4	# nb_inst_predict
+4	4	*4	# nb_inst_decod  
+4	4	*4	# nb_inst_update 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/config_multi_context.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/config_multi_context.cfg	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/config_multi_context.cfg	(revision 81)
@@ -0,0 +1,14 @@
+Prediction_unit_Glue
+4	4	+1	# nb_context     
+30	30	+32	# size_address   
+1	1	*4	# nb_instruction  [0] [nb_context]
+2	2	*4	# nb_instruction  [1] [nb_context]
+8	8	*4	# nb_instruction  [2] [nb_context]
+4	4	*4	# nb_instruction  [3] [nb_context]
+2	2	*4	# size_depth      [0] [nb_context]
+1	1	*4	# size_depth      [1] [nb_context]
+8	8	*4	# size_depth      [2] [nb_context]
+4	4	*4	# size_depth      [3] [nb_context]
+1	4	*4	# nb_inst_predict
+4	4	*4	# nb_inst_decod  
+4	4	*4	# nb_inst_update 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/include/test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/include/test.h	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/include/test.h	(revision 81)
@@ -0,0 +1,31 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test "RegisterFile"
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <string>
+#include <iostream>
+#include <sys/time.h>
+
+#include "Common/include/Time.h"
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h"
+
+using namespace std;
+using namespace morpheo;
+using namespace morpheo::behavioural;
+using namespace morpheo::behavioural::core;
+using namespace morpheo::behavioural::core::multi_front_end;
+using namespace morpheo::behavioural::core::multi_front_end::front_end;
+using namespace morpheo::behavioural::core::multi_front_end::front_end::prediction_unit;
+
+using namespace morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue;
+
+void test    (string name,
+	      morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue::Parameters * param);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/src/main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/src/main.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/src/main.cpp	(revision 81)
@@ -0,0 +1,87 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/include/test.h"
+
+#define NB_PARAMS 5
+
+void usage (int argc, char * argv[])
+{
+  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
+  err (_("list_params is :\n"));
+  err (_(" * nb_context                   (uint32_t)\n"));
+  err (_(" * size_address                 (uint32_t)\n"));
+  err (_(" * nb_instruction  [nb_context] (uint32_t)\n"));
+  err (_(" * size_depth      [nb_context] (uint32_t)\n"));
+  err (_(" * nb_inst_predict              (uint32_t)\n"));
+  err (_(" * nb_inst_decod                (uint32_t)\n"));
+  err (_(" * nb_inst_update               (uint32_t)\n"));
+
+  exit (1);
+}
+
+#ifndef SYSTEMC
+int main    (int argc, char * argv[])
+#else
+int sc_main (int argc, char * argv[])
+#endif
+{
+  if (argc < static_cast<int>(2+NB_PARAMS))
+    usage (argc, argv);
+
+  uint32_t x = 1;
+
+  string name = argv[x++];
+
+  uint32_t   _nb_context      = fromString<uint32_t>(argv[x++]);
+  uint32_t   _size_address    = fromString<uint32_t>(argv[x++]);
+  
+  if (argc != static_cast<int>(2+NB_PARAMS+2*_nb_context))
+    usage (argc, argv);
+
+  uint32_t * _nb_instruction  = new uint32_t [_nb_context];
+  for (uint32_t i=0; i<_nb_context; i++)
+    _nb_instruction [i] = fromString<uint32_t>(argv[x++]);
+  uint32_t * _size_depth      = new uint32_t [_nb_context];
+  for (uint32_t i=0; i<_nb_context; i++)
+    _size_depth     [i] = fromString<uint32_t>(argv[x++]);
+  uint32_t   _nb_inst_predict = fromString<uint32_t>(argv[x++]);
+  uint32_t   _nb_inst_decod   = fromString<uint32_t>(argv[x++]);
+  uint32_t   _nb_inst_update  = fromString<uint32_t>(argv[x++]);
+
+  int _return = EXIT_SUCCESS;
+  try 
+    {
+      morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue::Parameters
+	(_nb_context     ,
+	 _size_address   ,
+	 _nb_instruction ,
+	 _size_depth     ,
+	 _nb_inst_predict,
+	 _nb_inst_decod  ,
+	 _nb_inst_update );
+      
+      msg(_("%s"),param->print(1).c_str());
+      
+      test (name,param);
+    }
+  catch (morpheo::ErrorMorpheo & error)
+    {
+      msg (_("<%s> :\n%s"),name.c_str(), error.what ());
+      _return = EXIT_FAILURE;
+    }
+  catch (...)
+    {
+      err (_("<%s> : This test must generate a error.\n"),name.c_str());
+      _return = EXIT_FAILURE;
+    }
+
+  delete [] _nb_instruction;
+  delete [] _size_depth    ;
+
+  return (_return);
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/src/test.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/src/test.cpp	(revision 81)
@@ -0,0 +1,460 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test
+ */
+
+#define NB_ITERATION  16
+#define CYCLE_MAX     (1024*NB_ITERATION)
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/SelfTest/include/test.h"
+#include "Common/include/Test.h"
+#include "Behavioural/include/Allocation.h"
+
+void test (string name,
+	   morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue::Parameters * _param)
+{
+  msg(_("<%s> : Simulation SystemC.\n"),name.c_str());
+
+#ifdef STATISTICS
+  morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,50);
+#endif
+
+  Tusage_t _usage = USE_ALL;
+
+//   _usage = usage_unset(_usage,USE_SYSTEMC              );
+//   _usage = usage_unset(_usage,USE_VHDL                 );
+//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
+//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
+//   _usage = usage_unset(_usage,USE_POSITION             );
+//   _usage = usage_unset(_usage,USE_STATISTICS           );
+//   _usage = usage_unset(_usage,USE_INFORMATION          );
+
+  Prediction_unit_Glue * _Prediction_unit_Glue = new Prediction_unit_Glue 
+    (name.c_str(),
+#ifdef STATISTICS
+     _parameters_statistics,
+#endif
+     _param,
+     _usage);
+  
+#ifdef SYSTEMC
+  if (usage_is_set(_usage,USE_SYSTEMC))
+    {
+  /*********************************************************************
+   * Déclarations des signaux
+   *********************************************************************/
+  string rename;
+
+  sc_clock              *  in_CLOCK  = new sc_clock ("clock", 1.0, 0.5);	 
+  sc_signal<Tcontrol_t> *  in_NRESET = new sc_signal<Tcontrol_t> ("NRESET");
+
+  ALLOC1_SC_SIGNAL( in_PREDICT_VAL                         ," in_PREDICT_VAL                        ",Tcontrol_t         ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL(out_PREDICT_ACK                         ,"out_PREDICT_ACK                        ",Tcontrol_t         ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL( in_PREDICT_PC_PREVIOUS                 ," in_PREDICT_PC_PREVIOUS                ",Taddress_t         ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL( in_PREDICT_PC_CURRENT                  ," in_PREDICT_PC_CURRENT                 ",Taddress_t         ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL( in_PREDICT_PC_CURRENT_IS_DS_TAKE       ," in_PREDICT_PC_CURRENT_IS_DS_TAKE      ",Tcontrol_t         ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL(out_PREDICT_PC_NEXT                     ,"out_PREDICT_PC_NEXT                    ",Taddress_t         ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL(out_PREDICT_PC_NEXT_IS_DS_TAKE          ,"out_PREDICT_PC_NEXT_IS_DS_TAKE         ",Tcontrol_t         ,_param->_nb_context);
+  ALLOC2_SC_SIGNAL(out_PREDICT_INSTRUCTION_ENABLE          ,"out_PREDICT_INSTRUCTION_ENABLE         ",Tcontrol_t         ,_param->_nb_context,_param->_nb_instruction[alloc_signal_it1]);
+  ALLOC1_SC_SIGNAL(out_PREDICT_INST_IFETCH_PTR             ,"out_PREDICT_INST_IFETCH_PTR            ",Tinst_ifetch_ptr_t ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL(out_PREDICT_BRANCH_STATE                ,"out_PREDICT_BRANCH_STATE               ",Tbranch_state_t    ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID ,"out_PREDICT_BRANCH_UPDATE_PREDICTION_ID",Tprediction_ptr_t  ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL(out_PREDICT_BTB_VAL                     ,"out_PREDICT_BTB_VAL                    ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_BTB_ACK                     ," in_PREDICT_BTB_ACK                    ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_BTB_CONTEXT_ID              ,"out_PREDICT_BTB_CONTEXT_ID             ",Tcontext_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_BTB_ADDRESS                 ,"out_PREDICT_BTB_ADDRESS                ",Taddress_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_BTB_HIT                     ," in_PREDICT_BTB_HIT                    ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_BTB_ADDRESS_SRC             ," in_PREDICT_BTB_ADDRESS_SRC            ",Taddress_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_BTB_ADDRESS_DEST            ," in_PREDICT_BTB_ADDRESS_DEST           ",Taddress_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_BTB_CONDITION               ," in_PREDICT_BTB_CONDITION              ",Tbranch_condition_t,_param->_nb_inst_predict);
+//ALLOC1_SC_SIGNAL( in_PREDICT_BTB_LAST_TAKE               ," in_PREDICT_BTB_LAST_TAKE              ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_BTB_IS_ACCURATE             ," in_PREDICT_BTB_IS_ACCURATE            ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_DIR_VAL                     ,"out_PREDICT_DIR_VAL                    ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_DIR_ACK                     ," in_PREDICT_DIR_ACK                    ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_DIR_ADDRESS_SRC             ,"out_PREDICT_DIR_ADDRESS_SRC            ",Taddress_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_DIR_STATIC                  ,"out_PREDICT_DIR_STATIC                 ",Tcontrol_t         ,_param->_nb_inst_predict);
+//ALLOC1_SC_SIGNAL(out_PREDICT_DIR_LAST_TAKE               ,"out_PREDICT_DIR_LAST_TAKE              ",Tcontrol_t         ,_param->_nb_inst_predict);
+//ALLOC1_SC_SIGNAL( in_PREDICT_DIR_HISTORY                 ," in_PREDICT_DIR_HISTORY                ",Thistory_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_DIR_DIRECTION               ," in_PREDICT_DIR_DIRECTION              ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_RAS_VAL                     ,"out_PREDICT_RAS_VAL                    ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_RAS_ACK                     ," in_PREDICT_RAS_ACK                    ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_RAS_CONTEXT_ID              ,"out_PREDICT_RAS_CONTEXT_ID             ",Tcontext_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_RAS_HIT                     ," in_PREDICT_RAS_HIT                    ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_RAS_PUSH                    ,"out_PREDICT_RAS_PUSH                   ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_RAS_ADDRESS_PUSH            ,"out_PREDICT_RAS_ADDRESS_PUSH           ",Taddress_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_RAS_ADDRESS_POP             ," in_PREDICT_RAS_ADDRESS_POP            ",Taddress_t         ,_param->_nb_inst_predict);
+//ALLOC1_SC_SIGNAL( in_PREDICT_RAS_INDEX                   ," in_PREDICT_RAS_INDEX                  ",Tptr_t             ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_UPT_VAL                     ,"out_PREDICT_UPT_VAL                    ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_UPT_ACK                     ," in_PREDICT_UPT_ACK                    ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_UPT_CONTEXT_ID              ,"out_PREDICT_UPT_CONTEXT_ID             ",Tcontext_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_UPT_BTB_ADDRESS_SRC         ,"out_PREDICT_UPT_BTB_ADDRESS_SRC        ",Taddress_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_UPT_BTB_ADDRESS_DEST        ,"out_PREDICT_UPT_BTB_ADDRESS_DEST       ",Taddress_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_UPT_BTB_CONDITION           ,"out_PREDICT_UPT_BTB_CONDITION          ",Tbranch_condition_t,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_UPT_BTB_LAST_TAKE           ,"out_PREDICT_UPT_BTB_LAST_TAKE          ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_UPT_BTB_IS_ACCURATE         ,"out_PREDICT_UPT_BTB_IS_ACCURATE        ",Tcontrol_t         ,_param->_nb_inst_predict);
+//ALLOC1_SC_SIGNAL(out_PREDICT_UPT_DIR_HISTORY             ,"out_PREDICT_UPT_DIR_HISTORY            ",Thistory_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_UPT_RAS_ADDRESS             ,"out_PREDICT_UPT_RAS_ADDRESS            ",Taddress_t         ,_param->_nb_inst_predict);
+//ALLOC1_SC_SIGNAL(out_PREDICT_UPT_RAS_INDEX               ,"out_PREDICT_UPT_RAS_INDEX              ",Tptr_t             ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_DEPTH_UPT_NB_BRANCH                 ," in_DEPTH_UPT_NB_BRANCH                ",Tdepth_t           ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL( in_DEPTH_UPT_TAIL                      ," in_DEPTH_UPT_TAIL                     ",Tdepth_t           ,_param->_nb_context);
+  
+  /********************************************************
+   * Instanciation
+   ********************************************************/
+  
+  msg(_("<%s> : Instanciation of _Prediction_unit_Glue.\n"),name.c_str());
+
+  (*(_Prediction_unit_Glue->in_CLOCK))        (*(in_CLOCK));
+  (*(_Prediction_unit_Glue->in_NRESET))       (*(in_NRESET));
+
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_VAL                         ,_param->_nb_context);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_ACK                         ,_param->_nb_context);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_PC_PREVIOUS                 ,_param->_nb_context);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_PC_CURRENT                  ,_param->_nb_context);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_PC_CURRENT_IS_DS_TAKE       ,_param->_nb_context);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_PC_NEXT                     ,_param->_nb_context);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_PC_NEXT_IS_DS_TAKE          ,_param->_nb_context);
+  INSTANCE2_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_INSTRUCTION_ENABLE          ,_param->_nb_context,_param->_nb_instruction[alloc_signal_it1]);
+  for (uint32_t i=0; i<_param->_nb_context; i++)
+    {
+      if (_param->_have_port_inst_ifetch_ptr [i])
+	INSTANCE_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_INST_IFETCH_PTR [i]);
+      if (_param->_have_port_depth [i])
+	INSTANCE_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i]);
+    }
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_BRANCH_STATE                ,_param->_nb_context);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_BTB_VAL                     ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_BTB_ACK                     ,_param->_nb_inst_predict);
+  if (_param->_have_port_context_id)
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_BTB_CONTEXT_ID              ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_BTB_ADDRESS                 ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_BTB_HIT                     ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_BTB_ADDRESS_SRC             ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_BTB_ADDRESS_DEST            ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_BTB_CONDITION               ,_param->_nb_inst_predict);
+//INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_BTB_LAST_TAKE               ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_BTB_IS_ACCURATE             ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_DIR_VAL                     ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_DIR_ACK                     ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_DIR_ADDRESS_SRC             ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_DIR_STATIC                  ,_param->_nb_inst_predict);
+//INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_DIR_LAST_TAKE               ,_param->_nb_inst_predict);
+//INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_DIR_HISTORY                 ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_DIR_DIRECTION               ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_RAS_VAL                     ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_RAS_ACK                     ,_param->_nb_inst_predict);
+  if (_param->_have_port_context_id)
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_RAS_CONTEXT_ID              ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_RAS_HIT                     ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_RAS_PUSH                    ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_RAS_ADDRESS_PUSH            ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_RAS_ADDRESS_POP             ,_param->_nb_inst_predict);
+//INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_RAS_INDEX                   ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_UPT_VAL                     ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue, in_PREDICT_UPT_ACK                     ,_param->_nb_inst_predict);
+  if (_param->_have_port_context_id)
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_UPT_CONTEXT_ID              ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_UPT_BTB_ADDRESS_SRC         ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_UPT_BTB_ADDRESS_DEST        ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_UPT_BTB_CONDITION           ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_UPT_BTB_LAST_TAKE           ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_UPT_BTB_IS_ACCURATE         ,_param->_nb_inst_predict);
+//INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_UPT_DIR_HISTORY             ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_UPT_RAS_ADDRESS             ,_param->_nb_inst_predict);
+//INSTANCE1_SC_SIGNAL(_Prediction_unit_Glue,out_PREDICT_UPT_RAS_INDEX               ,_param->_nb_inst_predict);
+  for (uint32_t i=0; i<_param->_nb_context; i++)
+    {
+      if (_param->_have_port_depth [i])
+	{
+	  INSTANCE_SC_SIGNAL(_Prediction_unit_Glue, in_DEPTH_UPT_NB_BRANCH [i]);
+	  INSTANCE_SC_SIGNAL(_Prediction_unit_Glue, in_DEPTH_UPT_TAIL      [i]);
+	}
+    }
+
+  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
+    
+  Time * _time = new Time();
+
+  /********************************************************
+   * Simulation - Begin
+   ********************************************************/
+
+  // Initialisation
+
+  const uint32_t seed = 0;
+//const uint32_t seed = static_cast<uint32_t>(time(NULL));
+
+  srand(seed);
+
+  int32_t percent_transaction_predict =  75;
+
+  SC_START(0);
+  LABEL("Initialisation");
+
+  LABEL("Reset");
+
+  for (uint32_t i=0; i<_param->_nb_context; i++)
+    in_PREDICT_VAL [i]->write(0);
+  for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+    {
+      in_PREDICT_BTB_ACK         [i]->write(0);
+      in_PREDICT_DIR_ACK         [i]->write(0);
+      in_PREDICT_RAS_ACK         [i]->write(0);
+      in_PREDICT_UPT_ACK         [i]->write(0);
+
+      in_PREDICT_BTB_IS_ACCURATE [i]->write(1);
+    }
+
+  in_NRESET->write(0);
+  SC_START(5);
+  in_NRESET->write(1);  
+
+  LABEL("Loop of Test");
+
+
+  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
+    {
+      LABEL("Iteration %d",iteration);
+
+      {
+	LABEL("Test sequential");
+	uint32_t context = rand()%_param->_nb_context;
+	LABEL("context : %d",context);
+
+	for (uint32_t i=0; i<_param->_nb_instruction [context]; i++)
+	  {
+	    Taddress_t addr = (1<<(_param->_nb_instruction[context]+4))+i;
+	    
+	    in_PREDICT_PC_PREVIOUS           [context]->write(0);
+	    in_PREDICT_PC_CURRENT            [context]->write(addr);
+	    in_PREDICT_PC_CURRENT_IS_DS_TAKE [context]->write(0);
+
+	    bool find = false;
+
+	    do
+	      {
+		for (uint32_t j=0; j<_param->_nb_inst_predict; j++)
+		  in_PREDICT_BTB_ACK [j]->write(0);
+
+		in_PREDICT_VAL [context]->write((rand()%100)<percent_transaction_predict);
+
+		SC_START(0);
+
+		uint32_t port;
+		for (port=0; port<_param->_nb_inst_predict; port++)
+		  {
+		    if (_param->_have_port_context_id)
+		    LABEL(" * BTB context : 0x%x",out_PREDICT_BTB_CONTEXT_ID [port]->read());
+		    LABEL(" * BTB address : 0x%x",out_PREDICT_BTB_ADDRESS    [port]->read());
+		    if ((out_PREDICT_BTB_CONTEXT_ID [port]->read() == context) and
+			(out_PREDICT_BTB_ADDRESS    [port]->read() == addr   ))
+		      {
+			in_PREDICT_BTB_ACK [port]->write((rand()%100)<percent_transaction_predict);
+			in_PREDICT_BTB_HIT [port]->write(0);
+			break;
+		      }
+		  }
+
+		SC_START(0);
+
+		if (in_PREDICT_VAL[context]->read() and out_PREDICT_ACK[context]->read())
+		  {
+		    LABEL ("PREDICT         [%d] - Transaction accepted",context);
+		    find = true;
+
+		    TEST(Taddress_t        ,out_PREDICT_PC_NEXT                     [context]->read(),addr-i+_param->_nb_instruction[context]);
+		    TEST(Tcontrol_t        ,out_PREDICT_PC_NEXT_IS_DS_TAKE          [context]->read(),0);
+		    TEST(Tinst_ifetch_ptr_t,out_PREDICT_INST_IFETCH_PTR             [context]->read(),0);
+		    TEST(Tbranch_state_t   ,out_PREDICT_BRANCH_STATE                [context]->read(),BRANCH_STATE_NONE);
+		    TEST(Tprediction_ptr_t ,out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [context]->read(),0);
+		    
+		    for (uint32_t j=0; j<i; j++)
+		      TEST(Tcontrol_t        ,out_PREDICT_INSTRUCTION_ENABLE [context][j]->read(),0);
+		    for (uint32_t j=i; j<_param->_nb_instruction[context]; j++)
+		      TEST(Tcontrol_t        ,out_PREDICT_INSTRUCTION_ENABLE [context][j]->read(),1);
+		    
+		    TEST(Tcontrol_t        ,out_PREDICT_BTB_VAL        [port]->read(),1); 
+		    TEST(Tcontext_t        ,out_PREDICT_BTB_CONTEXT_ID [port]->read(),context);
+		    TEST(Taddress_t        ,out_PREDICT_BTB_ADDRESS    [port]->read(),addr);
+		  }
+
+		SC_START(1);
+
+	      } while(not find);
+
+	  
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      in_PREDICT_VAL [i]->write(0);
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		in_PREDICT_BTB_ACK [i]->write(0);
+		in_PREDICT_DIR_ACK [i]->write(0);
+		in_PREDICT_RAS_ACK [i]->write(0);
+		in_PREDICT_UPT_ACK [i]->write(0);
+	      }
+	  }
+      }
+
+      {
+      	LABEL("Test no sequential - L.J");
+	uint32_t context = rand()%_param->_nb_context;
+	
+	LABEL("context : %d",context);
+
+	for (uint32_t i=0; i<_param->_nb_instruction [context]; i++)
+	  {
+	    Taddress_t addr      = (1<<(_param->_nb_instruction[context]+4));
+	    Taddress_t addr_src  = addr+i;
+	    Taddress_t addr_dest = 0xdeadbeef;
+	    
+	    in_PREDICT_PC_PREVIOUS           [context]->write(0);
+	    in_PREDICT_PC_CURRENT            [context]->write(addr);
+	    in_PREDICT_PC_CURRENT_IS_DS_TAKE [context]->write(0);
+
+	    bool find = false;
+	    
+	    do
+	      {
+		for (uint32_t j=0; j<_param->_nb_inst_predict; j++)
+		  in_PREDICT_BTB_ACK [j]->write(0);
+
+		in_PREDICT_VAL [context]->write((rand()%100)<percent_transaction_predict);
+
+		SC_START(0);
+
+		uint32_t port;
+		for (port=0; port<_param->_nb_inst_predict; port++)
+		  {
+		    if (_param->_have_port_context_id)
+		    LABEL(" * BTB context : 0x%x",out_PREDICT_BTB_CONTEXT_ID [port]->read());
+		    LABEL(" * BTB address : 0x%x",out_PREDICT_BTB_ADDRESS    [port]->read());
+		    if ((out_PREDICT_BTB_CONTEXT_ID [port]->read() == context) and
+			(out_PREDICT_BTB_ADDRESS    [port]->read() == addr   ))
+		      {
+			in_PREDICT_BTB_ACK          [port]->write((rand()%100)<percent_transaction_predict);
+			in_PREDICT_BTB_HIT          [port]->write(1);
+
+			in_PREDICT_BTB_ADDRESS_SRC  [port]->write(addr_src );
+			in_PREDICT_BTB_ADDRESS_DEST [port]->write(addr_dest);
+			in_PREDICT_BTB_CONDITION    [port]->write(BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK); //l.j
+		      //in_PREDICT_BTB_LAST_TAKE
+
+			break;
+		      }
+		  }
+
+		SC_START(0);
+
+		if (in_PREDICT_VAL[context]->read() and out_PREDICT_ACK[context]->read())
+		  {
+		    LABEL ("PREDICT         [%d] - Transaction accepted",context);
+		    find = true;
+
+		    TEST(Taddress_t        ,out_PREDICT_PC_NEXT                     [context]->read(),addr_dest);
+// 		    TEST(Tcontrol_t        ,out_PREDICT_PC_NEXT_IS_DS_TAKE          [context]->read(),0);
+		    TEST(Tinst_ifetch_ptr_t,out_PREDICT_INST_IFETCH_PTR             [context]->read(),i);
+		    TEST(Tbranch_state_t   ,out_PREDICT_BRANCH_STATE                [context]->read(),BRANCH_STATE_NSPEC_TAKE);
+// 		    TEST(Tprediction_ptr_t ,out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [context]->read(),0);
+		    
+// 		    for (uint32_t j=0; j<i; j++)
+// 		      TEST(Tcontrol_t        ,out_PREDICT_INSTRUCTION_ENABLE [context][j]->read(),0);
+// 		    for (uint32_t j=i; j<_param->_nb_instruction[context]; j++)
+// 		      TEST(Tcontrol_t        ,out_PREDICT_INSTRUCTION_ENABLE [context][j]->read(),1);
+		    
+		    TEST(Tcontrol_t        ,out_PREDICT_BTB_VAL        [port]->read(),1); 
+		    TEST(Tcontext_t        ,out_PREDICT_BTB_CONTEXT_ID [port]->read(),context);
+		    TEST(Taddress_t        ,out_PREDICT_BTB_ADDRESS    [port]->read(),addr);
+		  }
+
+		SC_START(1);
+
+	      } while(not find);	    
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      in_PREDICT_VAL [i]->write(0);
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		in_PREDICT_BTB_ACK [i]->write(0);
+		in_PREDICT_DIR_ACK [i]->write(0);
+		in_PREDICT_RAS_ACK [i]->write(0);
+		in_PREDICT_UPT_ACK [i]->write(0);
+	      }
+	  }
+      }
+
+
+      SC_START(1);
+    }
+
+  /********************************************************
+   * Simulation - End
+   ********************************************************/
+
+  TEST_OK ("End of Simulation");
+  delete _time;
+
+  msg(_("<%s> : ............ Stop Simulation\n"),name.c_str());
+
+  delete in_CLOCK;
+  delete in_NRESET;
+
+  DELETE1_SC_SIGNAL( in_PREDICT_VAL                         ,_param->_nb_context);
+  DELETE1_SC_SIGNAL(out_PREDICT_ACK                         ,_param->_nb_context);
+  DELETE1_SC_SIGNAL( in_PREDICT_PC_PREVIOUS                 ,_param->_nb_context);
+  DELETE1_SC_SIGNAL( in_PREDICT_PC_CURRENT                  ,_param->_nb_context);
+  DELETE1_SC_SIGNAL( in_PREDICT_PC_CURRENT_IS_DS_TAKE       ,_param->_nb_context);
+  DELETE1_SC_SIGNAL(out_PREDICT_PC_NEXT                     ,_param->_nb_context);
+  DELETE1_SC_SIGNAL(out_PREDICT_PC_NEXT_IS_DS_TAKE          ,_param->_nb_context);
+  DELETE2_SC_SIGNAL(out_PREDICT_INSTRUCTION_ENABLE          ,_param->_nb_context,_param->_nb_instruction[alloc_signal_it1]);
+  DELETE1_SC_SIGNAL(out_PREDICT_INST_IFETCH_PTR             ,_param->_nb_context);
+  DELETE1_SC_SIGNAL(out_PREDICT_BRANCH_STATE                ,_param->_nb_context);
+  DELETE1_SC_SIGNAL(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID ,_param->_nb_context);
+  DELETE1_SC_SIGNAL(out_PREDICT_BTB_VAL                     ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_PREDICT_BTB_ACK                     ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_BTB_CONTEXT_ID              ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_BTB_ADDRESS                 ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_PREDICT_BTB_HIT                     ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_PREDICT_BTB_ADDRESS_SRC             ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_PREDICT_BTB_ADDRESS_DEST            ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_PREDICT_BTB_CONDITION               ,_param->_nb_inst_predict);
+//DELETE1_SC_SIGNAL( in_PREDICT_BTB_LAST_TAKE               ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_PREDICT_BTB_IS_ACCURATE             ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_DIR_VAL                     ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_PREDICT_DIR_ACK                     ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_DIR_ADDRESS_SRC             ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_DIR_STATIC                  ,_param->_nb_inst_predict);
+//DELETE1_SC_SIGNAL(out_PREDICT_DIR_LAST_TAKE               ,_param->_nb_inst_predict);
+//DELETE1_SC_SIGNAL( in_PREDICT_DIR_HISTORY                 ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_PREDICT_DIR_DIRECTION               ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_RAS_VAL                     ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_PREDICT_RAS_ACK                     ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_RAS_CONTEXT_ID              ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_PREDICT_RAS_HIT                     ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_RAS_PUSH                    ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_RAS_ADDRESS_PUSH            ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_PREDICT_RAS_ADDRESS_POP             ,_param->_nb_inst_predict);
+//DELETE1_SC_SIGNAL( in_PREDICT_RAS_INDEX                   ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_UPT_VAL                     ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_PREDICT_UPT_ACK                     ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_UPT_CONTEXT_ID              ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_UPT_BTB_ADDRESS_SRC         ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_UPT_BTB_ADDRESS_DEST        ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_UPT_BTB_CONDITION           ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_UPT_BTB_LAST_TAKE           ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_UPT_BTB_IS_ACCURATE         ,_param->_nb_inst_predict);
+//DELETE1_SC_SIGNAL(out_PREDICT_UPT_DIR_HISTORY             ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL(out_PREDICT_UPT_RAS_ADDRESS             ,_param->_nb_inst_predict);
+//DELETE1_SC_SIGNAL(out_PREDICT_UPT_RAS_INDEX               ,_param->_nb_inst_predict);
+  DELETE1_SC_SIGNAL( in_DEPTH_UPT_NB_BRANCH                 ,_param->_nb_context);
+  DELETE1_SC_SIGNAL( in_DEPTH_UPT_TAIL                      ,_param->_nb_context);
+    }
+#endif
+
+  delete _Prediction_unit_Glue;
+#ifdef STATISTICS
+  delete _parameters_statistics;
+#endif
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/Makefile	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/Makefile	(revision 81)
@@ -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/Prediction_unit_Glue/doc/Prediction_unit_Glue.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/Prediction_unit_Glue.tex	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/Prediction_unit_Glue.tex	(revision 81)
@@ -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/Prediction_unit_Glue/doc/sty/header.sty
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/sty/header.sty	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/sty/header.sty	(revision 81)
@@ -0,0 +1,12 @@
+\def\review{YYYY/MM/DD}
+%\def\review{\number\day/\number\month/\number\year\xspace}
+
+\title{Prediction_unit_Glue}
+ 
+\author{}
+
+\affiliation{}
+
+\email{}
+
+\date{\review}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/01_introduction.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/01_introduction.tex	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/01_introduction.tex	(revision 81)
@@ -0,0 +1,1 @@
+\Section{Introduction}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/02_features.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/02_features.tex	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/02_features.tex	(revision 81)
@@ -0,0 +1,1 @@
+\Section{Features}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/03_description.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/03_description.tex	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/03_description.tex	(revision 81)
@@ -0,0 +1,1 @@
+\Section{Functional Description}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/04_pinout.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/04_pinout.tex	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/04_pinout.tex	(revision 81)
@@ -0,0 +1,1 @@
+\Section{Pin out}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/05_parameters.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/05_parameters.tex	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/05_parameters.tex	(revision 81)
@@ -0,0 +1,1 @@
+\Section{Parameters}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/06_performance.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/06_performance.tex	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/06_performance.tex	(revision 81)
@@ -0,0 +1,1 @@
+\Section{Performance}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/07_details.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/07_details.tex	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/07_details.tex	(revision 81)
@@ -0,0 +1,1 @@
+\Section{Details}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/08_history.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/08_history.tex	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/08_history.tex	(revision 81)
@@ -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/Prediction_unit_Glue/doc/tex/root.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/root.tex	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/doc/tex/root.tex	(revision 81)
@@ -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/Prediction_unit_Glue/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Parameters.h	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Parameters.h	(revision 81)
@@ -0,0 +1,69 @@
+#ifndef morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_prediction_unit_glue_Parameters_h
+#define morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_prediction_unit_glue_Parameters_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Behavioural/include/Parameters.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+  class Parameters : public morpheo::behavioural::Parameters
+  {
+    //-----[ fields ]------------------------------------------------------------
+  public : uint32_t   _nb_context               ;
+  public : uint32_t   _size_address             ;
+  public : uint32_t * _nb_instruction           ;
+  public : uint32_t * _size_depth               ;
+  public : uint32_t   _nb_inst_predict          ;
+  public : uint32_t   _nb_inst_decod            ;
+  public : uint32_t   _nb_inst_update           ;
+//public : uint32_t   _nb_inst_branch_complete  ;
+
+  public : uint32_t   _size_context_id          ;
+  public : uint32_t * _size_inst_ifetch_ptr     ;
+
+  public : bool       _have_port_context_id     ;
+  public : bool     * _have_port_depth          ;    
+  public : bool     * _have_port_inst_ifetch_ptr;
+
+    //-----[ methods ]-----------------------------------------------------------
+  public : Parameters  (uint32_t   nb_context     ,
+			uint32_t   size_address   ,
+			uint32_t * nb_instruction ,
+			uint32_t * size_depth     ,
+			uint32_t   nb_inst_predict,
+			uint32_t   nb_inst_decod  ,
+			uint32_t   nb_inst_update );
+//   public : Parameters  (Parameters & param) ;
+  public : ~Parameters () ;
+
+  public :        Parameters_test msg_error  (void);
+
+  public :        std::string     print      (uint32_t depth);
+  public : friend std::ostream&   operator<< (std::ostream& output_stream,
+					    morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue::Parameters & x);
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h	(revision 81)
@@ -0,0 +1,263 @@
+#ifndef morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_prediction_unit_glue_Prediction_unit_Glue_h
+#define morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_prediction_unit_glue_Prediction_unit_Glue_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <iostream>
+#include "Common/include/ToString.h"
+#include "Common/include/Debug.h"
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Types.h"
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Parameters.h"
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+#endif
+#include "Behavioural/include/Component.h"
+#ifdef VHDL
+#include "Behavioural/include/Vhdl.h"
+#endif
+#include "Behavioural/include/Usage.h"
+
+namespace morpheo {
+namespace behavioural {
+
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+  class Prediction_unit_Glue 
+#if SYSTEMC
+    : public sc_module
+#endif
+  {
+    // -----[ fields ]----------------------------------------------------
+    // Parameters
+  protected : const std::string  _name;
+  protected : const Parameters * _param;
+  private   : const Tusage_t     _usage;
+
+#ifdef STATISTICS
+  public    : Stat                           * _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                         ; //[nb_context]
+  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_ACK                         ; //[nb_context]
+  public    : SC_IN (Taddress_t         )  **  in_PREDICT_PC_PREVIOUS                 ; //[nb_context]
+  public    : SC_IN (Taddress_t         )  **  in_PREDICT_PC_CURRENT                  ; //[nb_context]
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_PC_CURRENT_IS_DS_TAKE       ; //[nb_context]
+  public    : SC_OUT(Taddress_t         )  ** out_PREDICT_PC_NEXT                     ; //[nb_context]
+  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_PC_NEXT_IS_DS_TAKE          ; //[nb_context]
+  public    : SC_OUT(Tcontrol_t         ) *** out_PREDICT_INSTRUCTION_ENABLE          ; //[nb_context][nb_instruction]
+  public    : SC_OUT(Tinst_ifetch_ptr_t )  ** out_PREDICT_INST_IFETCH_PTR             ; //[nb_context]
+  public    : SC_OUT(Tbranch_state_t    )  ** out_PREDICT_BRANCH_STATE                ; //[nb_context]
+  public    : SC_OUT(Tprediction_ptr_t  )  ** out_PREDICT_BRANCH_UPDATE_PREDICTION_ID ; //[nb_context]
+
+  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_BTB_VAL                     ; //[nb_inst_predict] 
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_BTB_ACK                     ; //[nb_inst_predict] 
+  public    : SC_OUT(Tcontext_t         )  ** out_PREDICT_BTB_CONTEXT_ID              ; //[nb_inst_predict]
+  public    : SC_OUT(Taddress_t         )  ** out_PREDICT_BTB_ADDRESS                 ; //[nb_inst_predict]
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_BTB_HIT                     ; //[nb_inst_predict] 
+  public    : SC_IN (Taddress_t         )  **  in_PREDICT_BTB_ADDRESS_SRC             ; //[nb_inst_predict] 
+  public    : SC_IN (Taddress_t         )  **  in_PREDICT_BTB_ADDRESS_DEST            ; //[nb_inst_predict] 
+  public    : SC_IN (Tbranch_condition_t)  **  in_PREDICT_BTB_CONDITION               ; //[nb_inst_predict] 
+//public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_BTB_LAST_TAKE               ; //[nb_inst_predict]  DIR.LAST_TAKE
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_BTB_IS_ACCURATE             ; //[nb_inst_predict]
+										      		        
+  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_DIR_VAL                     ; //[nb_inst_predict] 
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_DIR_ACK                     ; //[nb_inst_predict] 
+  public    : SC_OUT(Taddress_t         )  ** out_PREDICT_DIR_ADDRESS_SRC             ; //[nb_inst_predict] 
+  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_DIR_STATIC                  ; //[nb_inst_predict] 
+//public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_DIR_LAST_TAKE               ; //[nb_inst_predict]  BTB.LAST_TAKE
+//public    : SC_IN (Thistory_t         )  **  in_PREDICT_DIR_HISTORY                 ; //[nb_inst_predict]  UPT.DIR_HISTORY
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_DIR_DIRECTION               ; //[nb_inst_predict] 
+
+  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_RAS_VAL                     ; //[nb_inst_predict] 
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_RAS_ACK                     ; //[nb_inst_predict] 
+  public    : SC_OUT(Tcontext_t         )  ** out_PREDICT_RAS_CONTEXT_ID              ; //[nb_inst_predict]
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_RAS_HIT                     ; //[nb_inst_predict]  
+  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_RAS_PUSH                    ; //[nb_inst_predict] 
+  public    : SC_OUT(Taddress_t         )  ** out_PREDICT_RAS_ADDRESS_PUSH            ; //[nb_inst_predict] 
+  public    : SC_IN (Taddress_t         )  **  in_PREDICT_RAS_ADDRESS_POP             ; //[nb_inst_predict] 
+//public    : SC_IN (Tptr_t             )  **  in_PREDICT_RAS_INDEX                   ; //[nb_inst_predict]  UPT.RAS_INDEX
+										      		        
+  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_UPT_VAL                     ; //[nb_inst_predict] 
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_UPT_ACK                     ; //[nb_inst_predict] 
+  public    : SC_OUT(Tcontext_t         )  ** out_PREDICT_UPT_CONTEXT_ID              ; //[nb_inst_predict]
+  public    : SC_OUT(Taddress_t         )  ** out_PREDICT_UPT_BTB_ADDRESS_SRC         ; //[nb_inst_predict]* BTB.ADDRESS_SRC
+  public    : SC_OUT(Taddress_t         )  ** out_PREDICT_UPT_BTB_ADDRESS_DEST        ; //[nb_inst_predict] 
+  public    : SC_OUT(Tbranch_condition_t)  ** out_PREDICT_UPT_BTB_CONDITION           ; //[nb_inst_predict]* BTB.CONDITION
+  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_UPT_BTB_LAST_TAKE           ; //[nb_inst_predict] 
+  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_UPT_BTB_IS_ACCURATE         ; //[nb_inst_predict]
+//public    : SC_OUT(Thistory_t         )  ** out_PREDICT_UPT_DIR_HISTORY             ; //[nb_inst_predict]  DIR.HISTORY
+  public    : SC_OUT(Taddress_t         )  ** out_PREDICT_UPT_RAS_ADDRESS             ; //[nb_inst_predict]* RAS.ADDRESS_POP
+//public    : SC_OUT(Tptr_t             )  ** out_PREDICT_UPT_RAS_INDEX               ; //[nb_inst_predict]  RAS.INDEX
+										      
+    // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	      
+  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_BTB_VAL                       ; //[nb_inst_decod]
+  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_BTB_ACK                       ; //[nb_inst_decod]
+  public    : SC_OUT(Tcontext_t         )  ** out_DECOD_BTB_CONTEXT_ID                ; //[nb_inst_decod]
+  public    : SC_OUT(Taddress_t         )  ** out_DECOD_BTB_ADDRESS_SRC               ; //[nb_inst_decod]
+  public    : SC_OUT(Taddress_t         )  ** out_DECOD_BTB_ADDRESS_DEST              ; //[nb_inst_decod]
+  public    : SC_OUT(Tbranch_condition_t)  ** out_DECOD_BTB_CONDITION                 ; //[nb_inst_decod]
+  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_BTB_LAST_TAKE                 ; //[nb_inst_decod]
+  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_BTB_MISS_PREDICTION           ; //[nb_inst_decod]
+									              
+  public    : SC_OUT(Tcontrol_t)           ** out_DECOD_RAS_VAL                       ; //[nb_inst_decod]
+  public    : SC_IN (Tcontrol_t)           **  in_DECOD_RAS_ACK                       ; //[nb_inst_decod]
+  public    : SC_OUT(Tcontext_t)           ** out_DECOD_RAS_CONTEXT_ID                ; //[nb_inst_decod] 
+  public    : SC_IN (Tcontrol_t)           **  in_DECOD_RAS_HIT                       ; //[nb_inst_decod] 
+  public    : SC_OUT(Tcontrol_t)           ** out_DECOD_RAS_PUSH                      ; //[nb_inst_decod]
+  public    : SC_OUT(Taddress_t)           ** out_DECOD_RAS_ADDRESS_PUSH              ; //[nb_inst_decod]
+  public    : SC_IN (Taddress_t)           **  in_DECOD_RAS_ADDRESS_POP               ; //[nb_inst_decod]
+  public    : SC_IN (Tptr_t    )           **  in_DECOD_RAS_INDEX                     ; //[nb_inst_decod]
+  public    : SC_OUT(Tcontrol_t)           ** out_DECOD_RAS_MISS_PREDICTION           ; //[nb_inst_decod]
+										      
+  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_UPT_VAL                       ; //[nb_inst_decod]
+  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_UPT_ACK                       ; //[nb_inst_decod]
+  public    : SC_OUT(Tcontext_t         )  ** out_DECOD_UPT_CONTEXT_ID                ; //[nb_inst_decod]
+  public    : SC_OUT(Taddress_t         )  ** out_DECOD_UPT_BTB_ADDRESS_SRC           ; //[nb_inst_decod]
+  public    : SC_OUT(Taddress_t         )  ** out_DECOD_UPT_BTB_ADDRESS_DEST          ; //[nb_inst_decod]
+  public    : SC_OUT(Tbranch_condition_t)  ** out_DECOD_UPT_BTB_CONDITION             ; //[nb_inst_decod]
+  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_UPT_BTB_LAST_TAKE             ; //[nb_inst_decod]
+  public    : SC_OUT(Taddress_t         )  ** out_DECOD_UPT_RAS_ADDRESS               ; //[nb_inst_decod]
+  public    : SC_OUT(Tptr_t             )  ** out_DECOD_UPT_RAS_INDEX                 ; //[nb_inst_decod]
+  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_UPT_MISS_PREDICTION           ; //[nb_inst_decod] 
+  public    : SC_OUT(Tprediction_ptr_t  )  ** out_DECOD_UPT_UPDATE_PREDICTION_ID      ; //[nb_inst_decod]
+										      
+    // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	      
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_BTB_VAL                      ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t         )  **  in_UPDATE_BTB_ACK                      ; //[nb_inst_update]
+  public    : SC_OUT(Tcontext_t         )  ** out_UPDATE_BTB_CONTEXT_ID               ; //[nb_inst_update]
+  public    : SC_OUT(Taddress_t         )  ** out_UPDATE_BTB_ADDRESS_SRC              ; //[nb_inst_update]
+  public    : SC_OUT(Taddress_t         )  ** out_UPDATE_BTB_ADDRESS_DEST             ; //[nb_inst_update]
+  public    : SC_OUT(Tbranch_condition_t)  ** out_UPDATE_BTB_CONDITION                ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_BTB_LAST_TAKE                ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_BTB_MISS_PREDICTION          ; //[nb_inst_update]
+										      
+  public    : SC_OUT(Tcontrol_t)           ** out_UPDATE_DIR_VAL                      ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t)           **  in_UPDATE_DIR_ACK                      ; //[nb_inst_update]
+  public    : SC_OUT(Taddress_t)           ** out_UPDATE_DIR_ADDRESS                  ; //[nb_inst_update]
+  public    : SC_OUT(Thistory_t)           ** out_UPDATE_DIR_HISTORY                  ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t)           ** out_UPDATE_DIR_DIRECTION                ; //[nb_inst_update]
+										      
+  public    : SC_OUT(Tcontrol_t)           ** out_UPDATE_RAS_VAL                      ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t)           **  in_UPDATE_RAS_ACK                      ; //[nb_inst_update]
+  public    : SC_OUT(Tcontext_t)           ** out_UPDATE_RAS_CONTEXT_ID               ; //[nb_inst_update] 
+  public    : SC_OUT(Tcontrol_t)           ** out_UPDATE_RAS_PUSH                     ; //[nb_inst_update]
+  public    : SC_OUT(Taddress_t)           ** out_UPDATE_RAS_ADDRESS                  ; //[nb_inst_update]
+  public    : SC_OUT(Tptr_t    )           ** out_UPDATE_RAS_INDEX                    ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t)           ** out_UPDATE_RAS_MISS_PREDICTION          ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t)           ** out_UPDATE_RAS_PREDICTION_IFETCH        ; //[nb_inst_update]
+										      
+  public    : SC_IN (Tcontrol_t         )  **  in_UPDATE_UPT_VAL                      ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_UPT_ACK                      ; //[nb_inst_update]
+  public    : SC_IN (Tcontext_t         )  **  in_UPDATE_UPT_CONTEXT_ID               ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t         )  **  in_UPDATE_UPT_MISS_PREDICTION          ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t         )  **  in_UPDATE_UPT_DIRECTION_GOOD           ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t         )  **  in_UPDATE_UPT_BTB_VAL                  ; //[nb_inst_update]
+  public    : SC_IN (Taddress_t         )  **  in_UPDATE_UPT_BTB_ADDRESS_SRC          ; //[nb_inst_update]
+  public    : SC_IN (Taddress_t         )  **  in_UPDATE_UPT_BTB_ADDRESS_DEST         ; //[nb_inst_update]
+  public    : SC_IN (Tbranch_condition_t)  **  in_UPDATE_UPT_BTB_CONDITION            ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t         )  **  in_UPDATE_UPT_DIR_VAL                  ; //[nb_inst_update]
+  public    : SC_IN (Thistory_t         )  **  in_UPDATE_UPT_DIR_HISTORY              ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t         )  **  in_UPDATE_UPT_RAS_VAL                  ; //[nb_inst_update]
+  public    : SC_IN (Taddress_t         )  **  in_UPDATE_UPT_RAS_ADDRESS              ; //[nb_inst_update]
+  public    : SC_IN (Tptr_t             )  **  in_UPDATE_UPT_RAS_INDEX                ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t         )  **  in_UPDATE_UPT_RAS_PREDICTION_IFETCH    ; //[nb_inst_update]
+										      
+    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	      
+  public    : SC_IN (Tdepth_t           )  **  in_DEPTH_UPT_NB_BRANCH                 ; //[nb_context]
+  public    : SC_IN (Tdepth_t           )  **  in_DEPTH_UPT_TAIL                      ; //[nb_context]
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+  private   : uint32_t                         reg_PREDICT_PRIORITY;
+
+    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#endif
+
+    // -----[ Methods ]---------------------------------------------------
+
+#ifdef SYSTEMC
+    SC_HAS_PROCESS (Prediction_unit_Glue);
+#endif
+  public  :          Prediction_unit_Glue              
+  (
+#ifdef SYSTEMC
+   sc_module_name                                name,
+#else					       
+   std::string                                   name,
+#endif					       
+#ifdef STATISTICS
+   morpheo::behavioural::Parameters_Statistics * param_statistics,
+#endif
+   Parameters                                  * param,
+   morpheo::behavioural::Tusage_t                usage
+   );
+  public  :          ~Prediction_unit_Glue             (void);
+					       
+  private : void        allocation                (
+#ifdef STATISTICS
+						   morpheo::behavioural::Parameters_Statistics * param_statistics
+#else
+						   void
+#endif
+						   );
+  private : void        deallocation              (void);
+					       
+#ifdef SYSTEMC				       
+  public  : void        transition                (void);
+//public  : void        genMoore                  (void);
+  public  : void        genMealy_predict          (void);
+//   public  : void        genMealy_decod            (void);
+//   public  : void        genMealy_update           (void);
+#endif					       
+
+#if VHDL				       
+  public  : void        vhdl                      (void);
+  private : void        vhdl_declaration          (Vhdl * & vhdl);
+  private : void        vhdl_body                 (Vhdl * & vhdl);
+#endif					       
+
+#ifdef STATISTICS
+  public  : void        statistics_allocation     (morpheo::behavioural::Parameters_Statistics * param_statistics);
+  public  : void        statistics_deallocation   (void);
+#endif
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+  private : void        end_cycle                 (void);
+#endif
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Types.h	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Types.h	(revision 81)
@@ -0,0 +1,31 @@
+#ifndef morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_prediction_unit_glue_Types_h
+#define morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_prediction_unit_glue_Types_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Types.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Parameters.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Parameters.cpp	(revision 81)
@@ -0,0 +1,84 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Parameters.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::Parameters"
+  Parameters::Parameters (uint32_t   nb_context     ,
+			  uint32_t   size_address   ,
+			  uint32_t * nb_instruction ,
+			  uint32_t * size_depth     ,
+			  uint32_t   nb_inst_predict,
+			  uint32_t   nb_inst_decod  ,
+			  uint32_t   nb_inst_update )
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+
+    _nb_context                = nb_context             ;
+    _size_address              = size_address           ;
+    _nb_instruction            = nb_instruction         ;
+    _size_depth                = size_depth             ;
+    _nb_inst_predict           = nb_inst_predict        ;
+    _nb_inst_decod             = nb_inst_decod          ;
+    _nb_inst_update            = nb_inst_update         ;
+
+    _size_context_id           = log2(_nb_context);
+    _size_inst_ifetch_ptr      = new uint32_t [_nb_context];
+
+    _have_port_context_id      = (_size_context_id>0);
+    _have_port_depth           = new bool [_nb_context];
+    _have_port_inst_ifetch_ptr = new bool [_nb_context];
+
+    for (uint32_t i=0; i<_nb_context; i++)
+      {
+	_size_inst_ifetch_ptr      [i] = log2(_nb_instruction [i]);
+	_have_port_depth           [i] = (_size_depth [i] > 0);
+	_have_port_inst_ifetch_ptr [i] = (_size_inst_ifetch_ptr [i] > 0);
+      }
+
+    test();
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+  
+// #undef  FUNCTION
+// #define FUNCTION "Prediction_unit_Glue::Parameters (copy)"
+//   Parameters::Parameters (Parameters & param)
+//   {
+//     log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+//     test();
+//     log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+//   };
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::~Parameters"
+  Parameters::~Parameters () 
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+    delete  [] _size_inst_ifetch_ptr     ;
+    delete  [] _have_port_depth          ;
+    delete  [] _have_port_inst_ifetch_ptr;
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Parameters_msg_error.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Parameters_msg_error.cpp	(revision 81)
@@ -0,0 +1,44 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Types.h"
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Parameters.h"
+#include <sstream>
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::msg_error"
+  Parameters_test Parameters::msg_error(void)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+
+    Parameters_test test ("Prediction_unit_Glue");
+
+    if (_nb_inst_predict > _nb_context)
+      test.error("nb_inst_predict must be <= nb_context\n");
+
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+
+    return test;
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Parameters_print.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Parameters_print.cpp	(revision 81)
@@ -0,0 +1,72 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Parameters.h"
+#include "Behavioural/include/XML.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::print"
+  std::string Parameters::print (uint32_t depth)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+
+    XML xml ("prediction_unit_glue");
+
+    xml.balise_open("prediction_unit_glue");
+    xml.singleton_begin("nb_context     "); xml.attribut("value",toString(_nb_context     )); xml.singleton_end();
+    xml.singleton_begin("size_address   "); xml.attribut("value",toString(_size_address   )); xml.singleton_end();
+    xml.singleton_begin("nb_inst_predict"); xml.attribut("value",toString(_nb_inst_predict)); xml.singleton_end();
+    xml.singleton_begin("nb_inst_decod  "); xml.attribut("value",toString(_nb_inst_decod  )); xml.singleton_end();
+    xml.singleton_begin("nb_inst_update "); xml.attribut("value",toString(_nb_inst_update )); xml.singleton_end();
+    for (uint32_t i=0;i<_nb_context; i++)
+      {
+        xml. balise_open_begin("component");
+        xml.  attribut("type","context");
+        xml.  attribut("id"  ,toString(i));
+        xml. balise_open_end();
+	xml.  singleton_begin("nb_instruction "); xml.attribut("value",toString(_nb_instruction [i])); xml.singleton_end();
+	xml.  singleton_begin("size_depth     "); xml.attribut("value",toString(_size_depth     [i])); xml.singleton_end();
+        xml. balise_close();
+      }
+    xml.balise_close();
+
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+    
+    return xml.get_body(depth);
+  };
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::operator<<"
+  std::ostream& operator<< (std::ostream& output_stream ,
+			    morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue::Parameters & x)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+
+    output_stream << x.print(0);
+    
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+
+    return output_stream;
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue.cpp	(revision 81)
@@ -0,0 +1,899 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::Prediction_unit_Glue"
+  Prediction_unit_Glue::Prediction_unit_Glue 
+  (
+#ifdef SYSTEMC
+   sc_module_name name,
+#else
+   string name,
+#endif
+#ifdef STATISTICS
+   morpheo::behavioural::Parameters_Statistics * param_statistics,
+#endif
+   morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue::Parameters * param,
+   morpheo::behavioural::Tusage_t usage
+   ):
+    _name              (name)
+    ,_param            (param)
+    ,_usage            (usage)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+
+    usage_environment(_usage);
+
+    log_printf(INFO,Prediction_unit_Glue,FUNCTION,"Allocation");
+
+    allocation (
+#ifdef STATISTICS
+		param_statistics
+#endif
+		);
+
+#ifdef STATISTICS
+    if (usage_is_set(_usage,USE_STATISTICS))
+      {	
+	log_printf(INFO,Prediction_unit_Glue,FUNCTION,"Allocation of statistics");
+
+	statistics_allocation(param_statistics);
+      }
+#endif
+
+#ifdef VHDL
+    if (usage_is_set(_usage,USE_VHDL))
+      {
+	// generate the vhdl
+	log_printf(INFO,Prediction_unit_Glue,FUNCTION,"Generate the vhdl");
+	
+	vhdl();
+      }
+#endif
+
+#ifdef SYSTEMC
+    if (usage_is_set(_usage,USE_SYSTEMC))
+      {
+	log_printf(INFO,Prediction_unit_Glue,FUNCTION,"Method - transition");
+
+	SC_METHOD (transition);
+	dont_initialize ();
+	sensitive << (*(in_CLOCK)).pos();
+	
+# ifdef SYSTEMCASS_SPECIFIC
+	// List dependency information
+# endif    
+
+	log_printf(INFO,Prediction_unit_Glue,FUNCTION,"Method - genMealy_predict");
+
+	SC_METHOD (genMealy_predict);
+	dont_initialize ();
+	sensitive << (*(in_CLOCK)).neg(); // use internal register
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  {
+	    sensitive << (*( in_PREDICT_VAL                         [i]))
+		      << (*( in_PREDICT_PC_PREVIOUS                 [i]))
+		      << (*( in_PREDICT_PC_CURRENT                  [i]))
+		      << (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	  }
+	for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	  {
+	    sensitive << (*( in_PREDICT_BTB_ACK              [i]))
+		      << (*( in_PREDICT_BTB_HIT              [i]))
+		      << (*( in_PREDICT_BTB_ADDRESS_SRC      [i]))
+		      << (*( in_PREDICT_BTB_ADDRESS_DEST     [i]))
+		      << (*( in_PREDICT_BTB_CONDITION        [i]))
+// 		      << (*( in_PREDICT_BTB_LAST_TAKE        [i]))
+		      << (*( in_PREDICT_BTB_IS_ACCURATE      [i]))
+		      << (*( in_PREDICT_DIR_ACK              [i]))
+// 		      << (*( in_PREDICT_DIR_HISTORY          [i]))
+		      << (*( in_PREDICT_DIR_DIRECTION        [i]))
+		      << (*( in_PREDICT_RAS_ACK              [i]))
+		      << (*( in_PREDICT_RAS_HIT              [i]))
+		      << (*( in_PREDICT_RAS_ADDRESS_POP      [i]))
+// 		      << (*( in_PREDICT_RAS_INDEX            [i]))
+		      << (*( in_PREDICT_UPT_ACK              [i]));
+	  }
+
+# ifdef SYSTEMCASS_SPECIFIC
+	// List dependency information
+	for (uint32_t x=0; x<_param->_nb_context; x++)
+	  {
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_ACK                         [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_PC_NEXT                     [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_PC_NEXT_IS_DS_TAKE          [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    if (_param->_have_port_inst_ifetch_ptr [x])
+	      {
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_INST_IFETCH_PTR             [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_BRANCH_STATE                [x]))(*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x]))(*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x]))(*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x]))(*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_BRANCH_STATE                [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    if (_param->_have_port_depth [x])
+	      {
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+	      }
+
+	    for (uint32_t y=0; y<_param->_nb_instruction[x]; y++)
+	      {
+		for (uint32_t i=0; i<_param->_nb_context; i++)
+		  {
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_VAL                         [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+		  }
+		for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+		  {
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_BTB_ACK              [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_BTB_HIT              [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_RAS_ACK              [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_RAS_HIT              [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_RAS_INDEX            [i]));
+		    (*(out_PREDICT_INSTRUCTION_ENABLE          [x][y])) (*( in_PREDICT_UPT_ACK              [i]));
+		  }
+	      }
+	  }
+
+	for (uint32_t x=0; x<_param->_nb_inst_predict; x++)
+	  {
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_BTB_VAL              [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    if (_param->_have_port_context_id)
+	      {
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_BTB_CONTEXT_ID       [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_BTB_ADDRESS          [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_DIR_VAL              [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_DIR_ADDRESS_SRC      [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_DIR_STATIC           [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+// 	    for (uint32_t i=0; i<_param->_nb_context; i++)
+// 	      {
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_VAL                         [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+// 	      }
+// 	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+// 	      {
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_BTB_ACK              [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_BTB_HIT              [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// // 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// // 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_RAS_ACK              [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_RAS_HIT              [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// // 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+// 		(*(out_PREDICT_DIR_LAST_TAKE        [x])) (*( in_PREDICT_UPT_ACK              [i]));
+// 	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_RAS_VAL              [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    if (_param->_have_port_context_id)
+	      {
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_RAS_CONTEXT_ID       [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_RAS_PUSH             [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_RAS_ADDRESS_PUSH     [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_UPT_VAL              [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    if (_param->_have_port_context_id)
+	      {
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_UPT_CONTEXT_ID       [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_SRC  [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_UPT_BTB_ADDRESS_DEST [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_UPT_BTB_CONDITION    [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_UPT_BTB_LAST_TAKE    [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_UPT_BTB_IS_ACCURATE  [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+// 	    for (uint32_t i=0; i<_param->_nb_context; i++)
+// 	      {
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_VAL                         [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+// 	      }
+// 	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+// 	      {
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_BTB_ACK              [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_BTB_HIT              [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// // 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// // 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_RAS_ACK              [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_RAS_HIT              [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// // 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+// 		(*(out_PREDICT_UPT_DIR_HISTORY      [x])) (*( in_PREDICT_UPT_ACK              [i]));
+// 	      }
+
+	    for (uint32_t i=0; i<_param->_nb_context; i++)
+	      {
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_VAL                         [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+	      }
+	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	      {
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_BTB_ACK              [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_BTB_HIT              [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// 		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// 		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_RAS_ACK              [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_RAS_HIT              [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// 		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+		(*(out_PREDICT_UPT_RAS_ADDRESS      [x])) (*( in_PREDICT_UPT_ACK              [i]));
+	      }
+
+// 	    for (uint32_t i=0; i<_param->_nb_context; i++)
+// 	      {
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_VAL                         [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_PC_PREVIOUS                 [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_PC_CURRENT                  [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_PC_CURRENT_IS_DS_TAKE       [i]));
+// 	      }
+// 	    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+// 	      {
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_BTB_ACK              [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_BTB_HIT              [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_BTB_ADDRESS_SRC      [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_BTB_ADDRESS_DEST     [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_BTB_CONDITION        [i]));
+// // 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_BTB_LAST_TAKE        [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_BTB_IS_ACCURATE      [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_DIR_ACK              [i]));
+// // 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_DIR_HISTORY          [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_DIR_DIRECTION        [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_RAS_ACK              [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_RAS_HIT              [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_RAS_ADDRESS_POP      [i]));
+// // 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_RAS_INDEX            [i]));
+// 		(*(out_PREDICT_UPT_RAS_INDEX        [x])) (*( in_PREDICT_UPT_ACK              [i]));
+// 	      }
+	  }
+# endif    
+	
+#endif
+      }
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+    
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::~Prediction_unit_Glue"
+  Prediction_unit_Glue::~Prediction_unit_Glue (void)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+
+#ifdef STATISTICS
+    if (usage_is_set(_usage,USE_STATISTICS))
+      {
+	statistics_deallocation();
+      }
+#endif
+
+    log_printf(INFO,Prediction_unit_Glue,FUNCTION,"Deallocation");
+    deallocation ();
+
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_allocation.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_allocation.cpp	(revision 81)
@@ -0,0 +1,162 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h"
+#include "Behavioural/include/Allocation.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::allocation"
+  void Prediction_unit_Glue::allocation 
+  (
+#ifdef STATISTICS
+   morpheo::behavioural::Parameters_Statistics * param_statistics
+#else
+   void
+#endif
+   )
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+
+    _component   = new Component (_usage);
+
+    Entity * entity = _component->set_entity (_name       
+					      ,"Prediction_unit_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_YES);
+      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
+    }
+
+    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      {
+	ALLOC1_INTERFACE("predict",IN,SOUTH,"Interface with ifetch unit",_param->_nb_context);
+	
+	ALLOC1_VALACK_IN ( in_PREDICT_VAL                        ,VAL);
+	ALLOC1_VALACK_OUT(out_PREDICT_ACK                        ,ACK);
+	ALLOC1_SIGNAL_IN ( in_PREDICT_PC_PREVIOUS                ,"pc_previous"                ,Taddress_t         ,_param->_size_address);
+	ALLOC1_SIGNAL_IN ( in_PREDICT_PC_CURRENT                 ,"pc_current"                 ,Taddress_t         ,_param->_size_address);
+	ALLOC1_SIGNAL_IN ( in_PREDICT_PC_CURRENT_IS_DS_TAKE      ,"pc_current_is_ds_take"      ,Tcontrol_t         ,1);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_PC_NEXT                    ,"pc_next"                    ,Taddress_t         ,_param->_size_address);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_PC_NEXT_IS_DS_TAKE         ,"pc_next_is_ds_take"         ,Tcontrol_t         ,1);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_INST_IFETCH_PTR            ,"inst_ifetch_ptr"            ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr [alloc_signal_it1]);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth [alloc_signal_it1]);
+      }
+      {
+	ALLOC2_INTERFACE("predict",IN,SOUTH,"Interface with ifetch unit",_param->_nb_context,_param->_nb_instruction[alloc_interface_it1]);
+	_ALLOC2_SIGNAL_OUT(out_PREDICT_INSTRUCTION_ENABLE         ,"instruction_enable"         ,Tcontrol_t         ,1,_param->_nb_context,_param->_nb_instruction[alloc_signal_it1]);
+      }
+      
+      {
+	ALLOC1_INTERFACE("predict_btb",OUT,NORTH,"Interface with ifetch unit",_param->_nb_inst_predict);
+	
+	ALLOC1_VALACK_OUT(out_PREDICT_BTB_VAL         ,VAL);
+	ALLOC1_VALACK_IN ( in_PREDICT_BTB_ACK         ,ACK);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_BTB_CONTEXT_ID  ,"context_id"  ,Tcontext_t         ,_param->_size_context_id);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_BTB_ADDRESS     ,"address"     ,Taddress_t         ,_param->_size_address);
+	ALLOC1_SIGNAL_IN ( in_PREDICT_BTB_HIT         ,"hit"         ,Tcontrol_t         ,1);
+	ALLOC1_SIGNAL_IN ( in_PREDICT_BTB_ADDRESS_SRC ,"address_src" ,Taddress_t         ,_param->_size_address);
+	ALLOC1_SIGNAL_IN ( in_PREDICT_BTB_ADDRESS_DEST,"address_dest",Taddress_t         ,_param->_size_address);
+	ALLOC1_SIGNAL_IN ( in_PREDICT_BTB_CONDITION   ,"condition"   ,Tbranch_condition_t,_param->_size_branch_condition);
+//      ALLOC1_SIGNAL_IN ( in_PREDICT_BTB_LAST_TAKE   ,"last_take"   ,Tcontrol_t         ,1);
+	ALLOC1_SIGNAL_IN ( in_PREDICT_BTB_IS_ACCURATE ,"is_accurate" ,Tcontrol_t         ,1);
+      }
+      
+      {
+	ALLOC1_INTERFACE("predict_dir",OUT,NORTH,"Interface with ifetch unit",_param->_nb_inst_predict);
+	
+	ALLOC1_VALACK_OUT(out_PREDICT_DIR_VAL        ,VAL);
+	ALLOC1_VALACK_IN ( in_PREDICT_DIR_ACK        ,ACK);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_DIR_ADDRESS_SRC,"address_src",Taddress_t         ,_param->_size_address);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_DIR_STATIC     ,"static"     ,Tcontrol_t         ,1);
+//      ALLOC1_SIGNAL_OUT(out_PREDICT_DIR_LAST_TAKE  ,"last_take"  ,Tcontrol_t         ,1);
+//      ALLOC1_SIGNAL_IN ( in_PREDICT_DIR_HISTORY    ,"history"    ,Thistory_t         ,_param->_size_history);
+	ALLOC1_SIGNAL_IN ( in_PREDICT_DIR_DIRECTION  ,"direction"  ,Tcontrol_t         ,1);
+      }
+      
+      {
+	ALLOC1_INTERFACE("predict_ras",OUT,NORTH,"Interface with ifetch unit",_param->_nb_inst_predict);
+	
+	ALLOC1_VALACK_OUT(out_PREDICT_RAS_VAL         ,VAL);
+	ALLOC1_VALACK_IN ( in_PREDICT_RAS_ACK         ,ACK);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_RAS_CONTEXT_ID  ,"context_id"  ,Tcontext_t         ,_param->_size_context_id);
+	ALLOC1_SIGNAL_IN ( in_PREDICT_RAS_HIT         ,"hit"         ,Tcontrol_t         ,1);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_RAS_PUSH        ,"push"        ,Tcontrol_t         ,1);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_RAS_ADDRESS_PUSH,"address_push",Taddress_t         ,_param->_size_address);
+	ALLOC1_SIGNAL_IN ( in_PREDICT_RAS_ADDRESS_POP ,"address_pop" ,Taddress_t         ,_param->_size_address);
+//      ALLOC1_SIGNAL_IN ( in_PREDICT_RAS_INDEX       ,"index"       ,Tptr_t             ,_param->_size_ras_index);
+      }
+      
+      {
+	ALLOC1_INTERFACE("predict_upt",OUT,NORTH,"Interface with ifetch unit",_param->_nb_inst_predict);
+	
+	ALLOC1_VALACK_OUT(out_PREDICT_UPT_VAL             ,VAL);
+	ALLOC1_VALACK_IN ( in_PREDICT_UPT_ACK             ,ACK);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_UPT_CONTEXT_ID      ,"context_id"      ,Tcontext_t         ,_param->_size_context_id);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_UPT_BTB_ADDRESS_SRC ,"btb_address_src" ,Taddress_t         ,_param->_size_address);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_UPT_BTB_ADDRESS_DEST,"btb_address_dest",Taddress_t         ,_param->_size_address);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_UPT_BTB_CONDITION   ,"btb_condition"   ,Tbranch_condition_t,_param->_size_branch_condition);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_UPT_BTB_LAST_TAKE   ,"btb_last_take"   ,Tcontrol_t         ,1);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_UPT_BTB_IS_ACCURATE ,"btb_is_accurate" ,Tcontrol_t         ,1);
+//      ALLOC1_SIGNAL_OUT(out_PREDICT_UPT_DIR_HISTORY     ,"dir_history"     ,Thistory_t         ,_param->_size_history);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_UPT_RAS_ADDRESS     ,"ras_address"     ,Taddress_t         ,_param->_size_address);
+//      ALLOC1_SIGNAL_OUT(out_PREDICT_UPT_RAS_INDEX       ,"ras_index"       ,Tptr_t             ,_param->_size_ras_index);
+      }
+    }
+    
+    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	      
+    {
+      ALLOC1_INTERFACE("depth",IN,NORTH,"Interface with depth",_param->_nb_context);
+      
+      ALLOC1_SIGNAL_IN (in_DEPTH_UPT_NB_BRANCH,"upt_nb_branch",Tdepth_t,_param->_size_depth[alloc_signal_it1]);
+      ALLOC1_SIGNAL_IN (in_DEPTH_UPT_TAIL     ,"upt_tail"     ,Tdepth_t,_param->_size_depth[alloc_signal_it1]);
+    }
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+#ifdef POSITION
+    if (usage_is_set(_usage,USE_POSITION))
+	_component->generate_file();
+#endif
+
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_deallocation.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_deallocation.cpp	(revision 81)
@@ -0,0 +1,98 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h"
+#include "Behavioural/include/Allocation.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::deallocation"
+  void Prediction_unit_Glue::deallocation (void)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+
+    if (usage_is_set(_usage,USE_SYSTEMC))
+      {
+	delete    in_CLOCK ;
+	delete    in_NRESET;
+
+	// ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+        DELETE1_SIGNAL( in_PREDICT_VAL                        ,_param->_nb_context     ,1);
+        DELETE1_SIGNAL(out_PREDICT_ACK                        ,_param->_nb_context     ,1);
+        DELETE1_SIGNAL( in_PREDICT_PC_PREVIOUS                ,_param->_nb_context     ,_param->_size_address);
+        DELETE1_SIGNAL( in_PREDICT_PC_CURRENT                 ,_param->_nb_context     ,_param->_size_address);
+        DELETE1_SIGNAL( in_PREDICT_PC_CURRENT_IS_DS_TAKE      ,_param->_nb_context     ,1);
+        DELETE1_SIGNAL(out_PREDICT_PC_NEXT                    ,_param->_nb_context     ,_param->_size_address);
+        DELETE1_SIGNAL(out_PREDICT_PC_NEXT_IS_DS_TAKE         ,_param->_nb_context     ,1);
+        DELETE1_SIGNAL(out_PREDICT_INST_IFETCH_PTR            ,_param->_nb_context     ,_param->_size_inst_ifetch_ptr [alloc_signal_it1]);
+        DELETE1_SIGNAL(out_PREDICT_BRANCH_STATE               ,_param->_nb_context     ,_param->_size_branch_state);
+        DELETE1_SIGNAL(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_context     ,_param->_size_depth [alloc_signal_it1]);
+        DELETE2_SIGNAL(out_PREDICT_INSTRUCTION_ENABLE         ,_param->_nb_context     ,_param->_nb_instruction[alloc_signal_it1],1);
+        DELETE1_SIGNAL(out_PREDICT_BTB_VAL                    ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL( in_PREDICT_BTB_ACK                    ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL(out_PREDICT_BTB_CONTEXT_ID             ,_param->_nb_inst_predict,_param->_size_context_id);
+        DELETE1_SIGNAL(out_PREDICT_BTB_ADDRESS                ,_param->_nb_inst_predict,_param->_size_address);
+        DELETE1_SIGNAL( in_PREDICT_BTB_HIT                    ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL( in_PREDICT_BTB_ADDRESS_SRC            ,_param->_nb_inst_predict,_param->_size_address);
+        DELETE1_SIGNAL( in_PREDICT_BTB_ADDRESS_DEST           ,_param->_nb_inst_predict,_param->_size_address);
+        DELETE1_SIGNAL( in_PREDICT_BTB_CONDITION              ,_param->_nb_inst_predict,_param->_size_branch_condition);
+//      DELETE1_SIGNAL( in_PREDICT_BTB_LAST_TAKE              ,_param->_nb_inst_predict,1);
+	DELETE1_SIGNAL( in_PREDICT_BTB_IS_ACCURATE            ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL(out_PREDICT_DIR_VAL                    ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL( in_PREDICT_DIR_ACK                    ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL(out_PREDICT_DIR_ADDRESS_SRC            ,_param->_nb_inst_predict,_param->_size_address);
+        DELETE1_SIGNAL(out_PREDICT_DIR_STATIC                 ,_param->_nb_inst_predict,1);
+//      DELETE1_SIGNAL(out_PREDICT_DIR_LAST_TAKE              ,_param->_nb_inst_predict,1);
+//      DELETE1_SIGNAL( in_PREDICT_DIR_HISTORY                ,_param->_nb_inst_predict,_param->_size_history);
+        DELETE1_SIGNAL( in_PREDICT_DIR_DIRECTION              ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL(out_PREDICT_RAS_VAL                    ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL( in_PREDICT_RAS_ACK                    ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL(out_PREDICT_RAS_CONTEXT_ID             ,_param->_nb_inst_predict,_param->_size_context_id);
+        DELETE1_SIGNAL( in_PREDICT_RAS_HIT                    ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL(out_PREDICT_RAS_PUSH                   ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL(out_PREDICT_RAS_ADDRESS_PUSH           ,_param->_nb_inst_predict,_param->_size_address);
+        DELETE1_SIGNAL( in_PREDICT_RAS_ADDRESS_POP            ,_param->_nb_inst_predict,_param->_size_address);
+//      DELETE1_SIGNAL( in_PREDICT_RAS_INDEX                  ,_param->_nb_inst_predict,_param->_size_ras_index);
+        DELETE1_SIGNAL(out_PREDICT_UPT_VAL                    ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL( in_PREDICT_UPT_ACK                    ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL(out_PREDICT_UPT_CONTEXT_ID             ,_param->_nb_inst_predict,_param->_size_context_id);
+        DELETE1_SIGNAL(out_PREDICT_UPT_BTB_ADDRESS_SRC        ,_param->_nb_inst_predict,_param->_size_address);
+        DELETE1_SIGNAL(out_PREDICT_UPT_BTB_ADDRESS_DEST       ,_param->_nb_inst_predict,_param->_size_address);
+        DELETE1_SIGNAL(out_PREDICT_UPT_BTB_CONDITION          ,_param->_nb_inst_predict,_param->_size_branch_condition);
+        DELETE1_SIGNAL(out_PREDICT_UPT_BTB_LAST_TAKE          ,_param->_nb_inst_predict,1);
+	DELETE1_SIGNAL(out_PREDICT_UPT_BTB_IS_ACCURATE        ,_param->_nb_inst_predict,1);
+//      DELETE1_SIGNAL(out_PREDICT_UPT_DIR_HISTORY            ,_param->_nb_inst_predict,_param->_size_history);
+        DELETE1_SIGNAL(out_PREDICT_UPT_RAS_ADDRESS            ,_param->_nb_inst_predict,_param->_size_address);
+//      DELETE1_SIGNAL(out_PREDICT_UPT_RAS_INDEX              ,_param->_nb_inst_predict,_param->_size_ras_index);
+
+	// ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	      
+	DELETE1_SIGNAL( in_DEPTH_UPT_NB_BRANCH,_param->_nb_context,_param->_size_depth[alloc_signal_it1]);
+	DELETE1_SIGNAL( in_DEPTH_UPT_TAIL     ,_param->_nb_context,_param->_size_depth[alloc_signal_it1]);
+      }
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    delete _component;
+
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_end_cycle.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_end_cycle.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_end_cycle.cpp	(revision 81)
@@ -0,0 +1,49 @@
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::end_cycle"
+void Prediction_unit_Glue::end_cycle ()
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+
+#ifdef STATISTICS
+    if (usage_is_set(_usage,USE_STATISTICS))
+      _stat->end_cycle();
+#endif    
+
+#ifdef VHDL_TESTBENCH
+    // Evaluation before read the ouput signal
+//  sc_start(0);
+    if (usage_is_set(_usage,USE_VHDL_TESTBENCH))
+      _interfaces->testbench();
+#endif
+
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_predict.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_predict.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_predict.cpp	(revision 81)
@@ -0,0 +1,306 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::genMealy_predict"
+  void Prediction_unit_Glue::genMealy_predict (void)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+    
+    Tcontrol_t ack [_param->_nb_context];
+    for (uint32_t i=0; i<_param->_nb_context; i++)
+      ack [i] = 0;
+    
+    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+      {
+	log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"PREDICT [%d]",i);
+
+	Tcontrol_t btb_val;
+	Tcontrol_t dir_val;
+	Tcontrol_t ras_val;
+	Tcontrol_t upt_val;
+
+	Tcontext_t context = (reg_PREDICT_PRIORITY+i)%_param->_nb_context;
+	log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"  * context    : %d",context);
+
+	ack [context] = 1;
+	    
+	if (PORT_READ(in_PREDICT_VAL[context]) == 0)
+	  {
+	    log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"  * not valid ...");
+
+	    btb_val = false;
+	    dir_val = false;
+	    ras_val = false;
+	    upt_val = false;
+	  }
+	else
+	  {
+	    log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"  * valid ...");
+
+	    Taddress_t          pc_previous           = PORT_READ(in_PREDICT_PC_PREVIOUS           [context]);
+	    Taddress_t          pc_current            = PORT_READ(in_PREDICT_PC_CURRENT            [context]);
+	    Tcontrol_t          pc_current_is_ds_take = PORT_READ(in_PREDICT_PC_CURRENT_IS_DS_TAKE [context]);
+
+	    Taddress_t          pc_next                     ;
+	    Tcontrol_t          pc_next_is_ds_take          ;
+	    Tbranch_state_t     branch_state                ;
+	    Tprediction_ptr_t   branch_update_prediction_id ;
+	    Tinst_ifetch_ptr_t  inst_ifetch_ptr             ;
+	    
+	    // STEP (1) - Compute the address source
+	    Taddress_t          address     = (pc_current_is_ds_take)?pc_previous:pc_current;
+	    Taddress_t          address_lsb = pc_current%_param->_nb_instruction [context]; //if pc_current_is_ds_take, then pc_current%_param->_nb_instruction [context] == 0
+	    Taddress_t          address_msb;
+
+	    log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"  * address    : 0x%x",address);
+
+	    // STEP (2) - Test if branch (access at branch_target_buffer)
+	    btb_val = true;
+	    ack [context] &= PORT_READ(in_PREDICT_BTB_ACK [i]);
+
+	    if (_param->_have_port_context_id)
+	    PORT_WRITE(out_PREDICT_BTB_CONTEXT_ID [i],context);
+	    PORT_WRITE(out_PREDICT_BTB_ADDRESS    [i],address);
+
+	    // special case :
+	    //  if pc_current_is_ds, then pc_previous have branch, also hit must be set.
+	    //  else : a another branch have eject this branch : can't accurate
+	    Tcontrol_t          hit         = PORT_READ(in_PREDICT_BTB_HIT[i]);
+	    Tcontrol_t          is_accurate = PORT_READ(in_PREDICT_BTB_IS_ACCURATE  [i]) and not (pc_current_is_ds_take and not hit);
+
+	    // STEP (3) : Test if have branch in the packet
+	    if (hit == 1)
+	      {
+		// STEP (3a) : branch - test condition
+
+		bool                use_dir      = false;
+		bool                use_ras      = false;
+		bool                use_upt      = false;
+		
+		Tbranch_condition_t cond         = PORT_READ(in_PREDICT_BTB_CONDITION    [i]);
+		Taddress_t          address_src  = PORT_READ(in_PREDICT_BTB_ADDRESS_SRC  [i]);
+		Taddress_t          address_dest = PORT_READ(in_PREDICT_BTB_ADDRESS_DEST [i]);
+		Tcontrol_t          push;
+		Tcontrol_t          direction;
+
+		switch (cond)
+		  {
+		  case BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK          : // l.j
+		    {
+		      // use none unit (dir, upt and ras)
+		      direction    = true;
+		      pc_next      = address_dest;
+		      branch_state = BRANCH_STATE_NSPEC_TAKE;
+		      break;
+		    }
+		  case BRANCH_CONDITION_NONE_WITH_WRITE_STACK             : // l.jal
+		    {
+		      use_upt      = true;
+		      use_ras      = true;
+		      push         = true;
+		      direction    = true;
+		      pc_next      = address_dest;
+		      branch_state = BRANCH_STATE_NSPEC_TAKE;
+		      break;
+		    }
+		  case BRANCH_CONDITION_FLAG_UNSET                        : // l.bnf
+		  case BRANCH_CONDITION_FLAG_SET                          : // l.bf
+		    {
+		      use_upt      = true;
+		      use_dir      = true;
+		      // Test direction
+		      direction = PORT_READ(in_PREDICT_DIR_DIRECTION [i]); // Direction is not the "flag predict" ... also flag_unset and flag_set is the same
+		      if (direction = 1)
+			{
+			  branch_state = BRANCH_STATE_SPEC_TAKE;
+			  pc_next      = address_dest;
+			}
+		      else
+			{
+			  branch_state = BRANCH_STATE_SPEC_NTAKE;
+			  pc_next      = address_src+8; // +4 = delay slot
+			}
+		      break;
+		    }
+		  case BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK : // l.jr (rb!=9)
+		    {
+		      use_upt      = true;
+		      use_ras      = true;
+		      push         = true;
+		      direction    = true;
+		      pc_next      = address_dest;
+		      branch_state = BRANCH_STATE_SPEC_TAKE;
+		      break;
+		    }
+		  case BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK    : // l.jalr
+		    {
+		      use_upt      = true;
+		      use_ras      = true;
+		      push         = true;
+		      direction    = true;
+		      pc_next      = address_dest;
+		      branch_state = BRANCH_STATE_NSPEC_TAKE;
+		      break;
+		    }
+		  case BRANCH_CONDITION_READ_STACK                        : // l.jr (rb==9)
+		    {
+		      use_upt      = true;
+		      use_ras      = true;
+		      push         = false;
+		      direction    = true;
+		      pc_next      = PORT_READ(in_PREDICT_RAS_ADDRESS_POP  [i]);
+		      branch_state = BRANCH_STATE_SPEC_TAKE;
+		      break;
+		    }
+		  default :
+		    {
+		      ERRORMORPHEO(FUNCTION,"Unknow Condition");
+		      break;
+		    }
+		  }
+
+		if (use_dir)
+		  {
+		    ack[context] &= PORT_READ(in_PREDICT_DIR_ACK [i]);
+		    PORT_WRITE(out_PREDICT_DIR_ADDRESS_SRC [i], address_src);
+		    PORT_WRITE(out_PREDICT_DIR_STATIC      [i], address_dest<address_src); // if destination is previous : the static direction is take
+// 		    PORT_WRITE(out_PREDICT_DIR_LAST_TAKE   [i], PORT_READ(in_PREDICT_BTB_LAST_TAKE [i]));
+		  }
+
+		if (use_ras)
+		  {
+		    ack[context] &= PORT_READ(in_PREDICT_RAS_ACK [i]);
+		    if (_param->_have_port_context_id)
+		    PORT_WRITE(out_PREDICT_RAS_CONTEXT_ID   [i], context);
+		    PORT_WRITE(out_PREDICT_RAS_PUSH         [i], push); 
+		    PORT_WRITE(out_PREDICT_RAS_ADDRESS_PUSH [i], address_src+8); 
+
+		    is_accurate &= PORT_READ(in_PREDICT_RAS_HIT [i]); // if miss - prediction is not accurate
+		  }
+
+		if (use_upt)
+		  {
+		    ack[context] &= PORT_READ(in_PREDICT_UPT_ACK [i]);
+		    
+		    PORT_WRITE(out_PREDICT_UPT_CONTEXT_ID       [i],context);
+		    PORT_WRITE(out_PREDICT_UPT_BTB_ADDRESS_SRC  [i],address_src);
+		    PORT_WRITE(out_PREDICT_UPT_BTB_ADDRESS_DEST [i],address_dest);
+		    PORT_WRITE(out_PREDICT_UPT_BTB_CONDITION    [i],cond);
+		    PORT_WRITE(out_PREDICT_UPT_BTB_LAST_TAKE    [i],direction);
+		    PORT_WRITE(out_PREDICT_UPT_BTB_IS_ACCURATE  [i],is_accurate);
+// 		    PORT_WRITE(out_PREDICT_UPT_DIR_HISTORY      [i],PORT_READ(in_PREDICT_DIR_HISTORY      [i]));
+		    PORT_WRITE(out_PREDICT_UPT_RAS_ADDRESS      [i],PORT_READ(in_PREDICT_RAS_ADDRESS_POP  [i]));
+// 		    PORT_WRITE(out_PREDICT_UPT_RAS_INDEX        [i],PORT_READ(in_PREDICT_RAS_INDEX        [i]));
+		  }
+
+		// ack = 1 if :
+		//   *             btb_ack
+		//   * use_dir and dir_ack
+		//   * use_ras and ras_ack
+		//   * use_upt and upt_ack
+// 		ack [context] = (PORT_READ(in_PREDICT_BTB_ACK [i]) and 
+// 				 (use_dir and PORT_READ(in_PREDICT_DIR_ACK [i])) and 
+// 				 (use_ras and PORT_READ(in_PREDICT_RAS_ACK [i])) and 
+// 				 (use_upt and PORT_READ(in_PREDICT_UPT_ACK [i])));
+
+		dir_val = (PORT_READ(in_PREDICT_BTB_ACK [i]) and 
+			   (use_ras and PORT_READ(in_PREDICT_RAS_ACK [i])) and 
+			   (use_upt and PORT_READ(in_PREDICT_UPT_ACK [i])));
+
+		ras_val = (PORT_READ(in_PREDICT_BTB_ACK [i]) and 
+			   (use_dir and PORT_READ(in_PREDICT_DIR_ACK [i])) and 
+			   (use_upt and PORT_READ(in_PREDICT_UPT_ACK [i])));
+
+		upt_val = (PORT_READ(in_PREDICT_BTB_ACK [i]) and 
+			   (use_dir and PORT_READ(in_PREDICT_DIR_ACK [i])) and 
+			   (use_ras and PORT_READ(in_PREDICT_RAS_ACK [i])));
+
+// 		pc_next      - is previously computed
+// 		branch_state - is previously computed
+
+		Taddress_t address_src_lsb  = address_src%_param->_nb_instruction [context];
+
+		if (address_src_lsb == (_param->_nb_instruction [context]-1))
+		  {
+		    // branch is in the last slot of the packet
+		    address_msb        = _param->_nb_instruction [context]; // == (address_src_lsb+1)
+		    pc_next_is_ds_take = 1;
+		  }
+		else
+		  {
+		    // branch is in the last slot of the packet
+		    address_msb        = (address_src_lsb+2); // +1 == delayed slot
+		    pc_next_is_ds_take = 0;
+		  }
+
+		inst_ifetch_ptr             = address_src_lsb;
+		branch_update_prediction_id = (PORT_READ(in_DEPTH_UPT_TAIL[context])+PORT_READ(in_DEPTH_UPT_NB_BRANCH [context]))%_param->_size_depth[context];
+	      }
+	    else
+	      {
+		// STEP (3b) : Sequential order : compute next paquet
+		log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"  * BTB miss : sequential order");
+
+		pc_next                     = address-address_lsb+_param->_nb_instruction [context]; // sequencial
+		pc_next_is_ds_take          = 0; // no branch, also no delay slot
+		inst_ifetch_ptr             = 0;
+		branch_state                = BRANCH_STATE_NONE;
+		branch_update_prediction_id = 0;
+
+		address_msb = _param->_nb_instruction [context];
+	      }
+	      
+	      PORT_WRITE(out_PREDICT_PC_NEXT                     [context]   , pc_next                    );
+	      PORT_WRITE(out_PREDICT_PC_NEXT_IS_DS_TAKE          [context]   , pc_next_is_ds_take         );
+	      for (uint32_t j=0; j<address_lsb; j++)
+	      PORT_WRITE(out_PREDICT_INSTRUCTION_ENABLE          [context][j], 0); // Before the address : not valid
+	      for (uint32_t j=address_lsb; j<((pc_current_is_ds_take)?1:address_msb); j++)
+	      PORT_WRITE(out_PREDICT_INSTRUCTION_ENABLE          [context][j], 1); // Vald packet
+	      for (uint32_t j=((pc_current_is_ds_take)?1:address_msb); j<_param->_nb_instruction [context]; j++)
+	      PORT_WRITE(out_PREDICT_INSTRUCTION_ENABLE          [context][j], 0); // After last address (branch) : not valid
+	      if (_param->_have_port_inst_ifetch_ptr[context])
+	      PORT_WRITE(out_PREDICT_INST_IFETCH_PTR             [context]   , inst_ifetch_ptr            );
+	      PORT_WRITE(out_PREDICT_BRANCH_STATE                [context]   , branch_state               );
+	      if (_param->_have_port_depth[context])
+	      PORT_WRITE(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [context]   , branch_update_prediction_id);
+	  }
+
+	// Write output
+	PORT_WRITE(out_PREDICT_BTB_VAL [i], btb_val);
+	PORT_WRITE(out_PREDICT_DIR_VAL [i], dir_val);
+	PORT_WRITE(out_PREDICT_RAS_VAL [i], ras_val);
+	PORT_WRITE(out_PREDICT_UPT_VAL [i], upt_val);
+      }
+
+    for (uint32_t i=0; i<_param->_nb_context; i++)
+      PORT_WRITE(out_PREDICT_ACK[i],ack[i]);
+
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_statistics_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_statistics_allocation.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_statistics_allocation.cpp	(revision 81)
@@ -0,0 +1,41 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::statistics_allocation"
+  void Prediction_unit_Glue::statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+
+    _stat = new Stat (static_cast<std::string>(_name),
+		      "Prediction_unit_Glue",
+		      param_statistics);
+    
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_statistics_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_statistics_deallocation.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_statistics_deallocation.cpp	(revision 81)
@@ -0,0 +1,41 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::statistics_deallocation"
+  void Prediction_unit_Glue::statistics_deallocation (void)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+
+    log_printf(INFO,Prediction_unit_Glue,FUNCTION,"Generate Statistics file");
+    
+    delete _stat;
+    
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_transition.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_transition.cpp	(revision 81)
@@ -0,0 +1,50 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::transition"
+  void Prediction_unit_Glue::transition (void)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+
+    if (PORT_READ(in_NRESET) == 0)
+      {
+	reg_PREDICT_PRIORITY = 0;
+      }
+    else
+      {
+	// Round robin priority
+	reg_PREDICT_PRIORITY = (reg_PREDICT_PRIORITY+_param->_nb_inst_predict)%_param->_nb_context;
+      }
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+    end_cycle ();
+#endif
+
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_vhdl.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_vhdl.cpp	(revision 81)
@@ -0,0 +1,50 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h"
+#include "Behavioural/include/Vhdl.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::vhdl"
+  void Prediction_unit_Glue::vhdl (void)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"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,Prediction_unit_Glue,FUNCTION,"End");
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_vhdl_body.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_vhdl_body.cpp	(revision 81)
@@ -0,0 +1,37 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::vhdl_body"
+  void Prediction_unit_Glue::vhdl_body (Vhdl * & vhdl)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+    vhdl->set_body ("");
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_vhdl_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_vhdl_declaration.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_vhdl_declaration.cpp	(revision 81)
@@ -0,0 +1,36 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Prediction_unit_Glue.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace prediction_unit_glue {
+
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit_Glue::vhdl_declaration"
+  void Prediction_unit_Glue::vhdl_declaration (Vhdl * & vhdl)
+  {
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
+    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
+  };
+
+}; // end namespace prediction_unit_glue
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/SelfTest/config_mono_context.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/SelfTest/config_mono_context.cfg	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/SelfTest/config_mono_context.cfg	(revision 81)
@@ -1,5 +1,5 @@
 Return_Address_Stack
 1	1	+1	# nb_context     
-2	2	*2	# size_queue     [0]
+2	4	*2	# size_queue     [0]
 32	32	*2	# size_address   
 1	1	+1	# nb_inst_predict
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/SelfTest/src/test.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/SelfTest/src/test.cpp	(revision 81)
@@ -11,6 +11,6 @@
 #include "Behavioural/include/Allocation.h"
 
-#define NB_ITERATION  1024
-#define CYCLE_MAX     (128*NB_ITERATION)
+#define NB_ITERATION  16
+#define CYCLE_MAX     (1024*NB_ITERATION)
 
 #define LABEL(str...)							\
@@ -21,23 +21,21 @@
   } while(0)
 
-#define SC_START(cycle_offset)                                                       \
-  do									             \
-    {									             \
-      /*cout << "SC_START (begin)" << endl;*/				             \
-									             \
-      uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time());          \
-      if (cycle_offset != 0)						             \
-	{								             \
-	  cout << "##########[ cycle "<< cycle_current+cycle_offset << " ]" << endl; \
-	}								             \
-									             \
-      if (cycle_current > CYCLE_MAX)					             \
-	{								             \
-	  TEST_KO("Maximal cycles Reached");				             \
-	}								             \
-									             \
-      sc_start(cycle_offset);						             \
-									             \
-      /*cout << "SC_START (end  )" << endl;*/				             \
+#define SC_START(cycle_offset)						\
+  do									\
+    {									\
+      uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time()); \
+      if (cycle_offset != 0)						\
+	{								\
+	  cout << "##########[ cycle "<< cycle_current+cycle_offset << " ]"; \
+	  cout << " (" << __LINE__ << ")" << endl;			\
+	}								\
+      									\
+      if (cycle_current > CYCLE_MAX)					\
+	{								\
+	  TEST_KO("Maximal cycles Reached");				\
+	}								\
+      									\
+      sc_start(cycle_offset);						\
+      									\
     } while(0)
 
@@ -90,4 +88,5 @@
   ALLOC1_SC_SIGNAL( in_UPDATE_ADDRESS        ," in_UPDATE_ADDRESS        ",Taddress_t,_param->_nb_inst_update );
   ALLOC1_SC_SIGNAL( in_UPDATE_MISS_PREDICTION," in_UPDATE_MISS_PREDICTION",Tcontrol_t,_param->_nb_inst_update );
+  ALLOC1_SC_SIGNAL( in_UPDATE_PREDICTION_IFETCH," in_UPDATE_PREDICTION_IFETCH",Tcontrol_t,_param->_nb_inst_update );
   
   /********************************************************
@@ -127,4 +126,5 @@
   INSTANCE1_SC_SIGNAL(_Return_Address_Stack, in_UPDATE_ADDRESS        ,_param->_nb_inst_update );
   INSTANCE1_SC_SIGNAL(_Return_Address_Stack, in_UPDATE_MISS_PREDICTION,_param->_nb_inst_update );
+  INSTANCE1_SC_SIGNAL(_Return_Address_Stack, in_UPDATE_PREDICTION_IFETCH,_param->_nb_inst_update );
 
   msg(_("<%s> : Start Simulation ............\n"),name.c_str());
@@ -157,5 +157,276 @@
       LABEL("Iteration %d",iteration);
 
-      SC_START(1);
+      if (1)
+	{
+	uint32_t port = rand()%_param->_nb_inst_predict;
+
+	LABEL("PREDICT - PUSH");
+	
+	in_PREDICT_VAL  [port]->write(1);
+	in_PREDICT_PUSH [port]->write(1);
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  for (uint32_t j=0; j<_param->_size_queue[i]; j++)
+	    {
+	      in_PREDICT_CONTEXT_ID   [port]->write(i);
+	      in_PREDICT_ADDRESS_PUSH [port]->write(0xdeadbeef+j);
+	      
+	      SC_START(0);
+	      
+	      TEST(Tcontrol_t, out_PREDICT_ACK  [port]->read(), 1);
+	      TEST(Tptr_t    , out_PREDICT_INDEX[port]->read(),(j+1)%_param->_size_queue[i]);
+	      
+	      SC_START(1);
+	      
+	    }
+	in_PREDICT_VAL [port]->write(0);
+	
+	SC_START(1);
+	
+	in_PREDICT_VAL  [port]->write(1);
+	in_PREDICT_PUSH [port]->write(1);
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  for (uint32_t j=0; j<_param->_size_queue[i]; j++)
+	    {
+	      in_PREDICT_CONTEXT_ID   [port]->write(i);
+	      in_PREDICT_ADDRESS_PUSH [port]->write(0x21071981+j);
+	      
+	      SC_START(0);
+	      
+	      TEST(Tcontrol_t, out_PREDICT_ACK        [port]->read(), 1);
+	      TEST(Tptr_t    , out_PREDICT_INDEX      [port]->read(),(j+1)%_param->_size_queue[i]);
+	      TEST(Taddress_t, out_PREDICT_ADDRESS_POP[port]->read(),0xdeadbeef+j);
+	      
+	      SC_START(1);
+	    }
+	in_PREDICT_VAL [port]->write(0);
+	
+	LABEL("PREDICT - POP");
+	
+	in_PREDICT_VAL  [port]->write(1);
+	in_PREDICT_PUSH [port]->write(0);
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  for (uint32_t j=0; j< _param->_size_queue[i]; j++)
+	    {
+	      in_PREDICT_CONTEXT_ID   [port]->write(i);
+	      in_PREDICT_ADDRESS_PUSH [port]->write(0xbabedead);
+	      
+	      SC_START(0);
+	      
+	      TEST(Tcontrol_t, out_PREDICT_ACK        [port]->read(), 1);
+	      TEST(Tcontrol_t, out_PREDICT_HIT        [port]->read(), 1);
+	      uint32_t k=(_param->_size_queue[i]-j)%_param->_size_queue[i];
+	      TEST(Tptr_t    , out_PREDICT_INDEX      [port]->read(), k);
+	      TEST(Taddress_t, out_PREDICT_ADDRESS_POP[port]->read(),(0x21071981+((k==0)?(_param->_size_queue[i]-1):(k-1))));
+	      
+	      SC_START(1);
+	    }
+	in_PREDICT_VAL [port]->write(0);
+	}
+
+      // Now, the stack is empty
+
+      if (1)
+	{
+	uint32_t port1 = rand()%_param->_nb_inst_decod;
+	uint32_t port2 = rand()%_param->_nb_inst_predict;
+
+	LABEL("DECOD - without predict");
+	
+	LABEL("DECOD - PUSH");  
+	
+	in_DECOD_VAL             [port1]->write(1);
+	in_DECOD_PUSH            [port1]->write(1);
+	in_DECOD_MISS_PREDICTION [port1]->write(0);
+	
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  for (uint32_t j=0; j<_param->_size_queue[i]; j++)
+	    {
+	      in_DECOD_CONTEXT_ID   [port1]->write(i);
+	      in_DECOD_ADDRESS_PUSH [port1]->write(0xbeefcaca+j);
+	      
+	      SC_START(0);
+	      
+	      TEST(Tcontrol_t, out_DECOD_ACK  [port1]->read(), 1);
+	      TEST(Tptr_t    , out_DECOD_INDEX[port1]->read(),(j+1)%_param->_size_queue[i]);
+	      
+	      SC_START(1);
+	      
+	    }
+	in_DECOD_VAL [port1]->write(0);
+	
+	SC_START(1);
+	
+	in_DECOD_VAL  [port1]->write(1);
+	in_DECOD_PUSH [port1]->write(1);
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  for (uint32_t j=0; j<_param->_size_queue[i]; j++)
+	    {
+	      in_DECOD_CONTEXT_ID   [port1]->write(i);
+	      in_DECOD_ADDRESS_PUSH [port1]->write(0x21071981+j);
+	      
+	      SC_START(0);
+	      
+	      TEST(Tcontrol_t, out_DECOD_ACK        [port1]->read(), 1);
+	      TEST(Tptr_t    , out_DECOD_INDEX      [port1]->read(),(j+1)%_param->_size_queue[i]);
+	      TEST(Taddress_t, out_DECOD_ADDRESS_POP[port1]->read(),0xbeefcaca+j);
+	      
+	      SC_START(1);
+	    }
+	in_DECOD_VAL [port1]->write(0);
+	
+	LABEL("DECOD - POP");
+	
+	in_DECOD_VAL  [port1]->write(1);
+	in_DECOD_PUSH [port1]->write(0);
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  for (uint32_t j=0; j< _param->_size_queue[i]; j++)
+	    {
+	      in_DECOD_CONTEXT_ID   [port1]->write(i);
+	      in_DECOD_ADDRESS_PUSH [port1]->write(0xbabedead);
+	      
+	      SC_START(0);
+	      
+	      TEST(Tcontrol_t, out_DECOD_ACK        [port1]->read(), 1);
+	      TEST(Tcontrol_t, out_DECOD_HIT        [port1]->read(), 1);
+	      uint32_t k=(_param->_size_queue[i]-j)%_param->_size_queue[i];
+	      TEST(Tptr_t    , out_DECOD_INDEX      [port1]->read(), k);
+	      TEST(Taddress_t, out_DECOD_ADDRESS_POP[port1]->read(),(0x21071981+((k==0)?(_param->_size_queue[i]-1):(k-1))));
+	      
+	      SC_START(1);
+	    }
+	in_DECOD_VAL [port1]->write(0);
+
+	LABEL("DECOD - with predict");
+	
+	LABEL("DECOD - PUSH (size_queue/2)");  
+	
+	in_DECOD_VAL             [port1]->write(1);
+	in_DECOD_PUSH            [port1]->write(1);
+	in_DECOD_MISS_PREDICTION [port1]->write(1);
+	
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  for (uint32_t j=0; j<_param->_size_queue[i]/2;j++)
+	    {
+	      in_DECOD_CONTEXT_ID   [port1]->write(i);
+	      in_DECOD_ADDRESS_PUSH [port1]->write(0x01234567+j);
+	      
+	      SC_START(0);
+	      
+	      TEST(Tcontrol_t, out_DECOD_ACK  [port1]->read(), 1);
+	      TEST(Tptr_t    , out_DECOD_INDEX[port1]->read(),(j+1)%_param->_size_queue[i]);
+	      
+	      SC_START(1);
+	      
+	    }
+	in_DECOD_VAL [port1]->write(0);
+
+	LABEL("PREDICT - PUSH (size_queue/2)");  
+	
+	in_PREDICT_VAL             [port2]->write(1);
+	in_PREDICT_PUSH            [port2]->write(1);
+	
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  for (uint32_t j=0; j<_param->_size_queue[i]/2;j++)
+	    {
+	      in_PREDICT_CONTEXT_ID   [port2]->write(i);
+	      in_PREDICT_ADDRESS_PUSH [port2]->write((0x89abcdef+j)+(_param->_size_queue[i]/2));
+	      
+	      SC_START(0);
+	      
+	      TEST(Tcontrol_t, out_PREDICT_ACK  [port2]->read(), 1);
+	      TEST(Tptr_t    , out_PREDICT_INDEX[port2]->read(),(j+1+(_param->_size_queue[i]/2))%_param->_size_queue[i]);
+	      
+	      SC_START(1);
+	    }
+
+	in_PREDICT_VAL [port2]->write(0);
+
+	LABEL("PREDICT - POP (size_queue/2)");  
+
+	in_PREDICT_VAL  [port2]->write(1);
+	in_PREDICT_PUSH [port2]->write(0);
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  {
+	    for (uint32_t j=0; j< _param->_size_queue[i]/2; j++)
+	      {
+		in_PREDICT_CONTEXT_ID   [port2]->write(i);
+		in_PREDICT_ADDRESS_PUSH [port2]->write(0xbabedead);
+		
+		SC_START(0);
+		
+		TEST(Tcontrol_t, out_PREDICT_ACK        [port2]->read(), 1);
+		TEST(Tcontrol_t, out_PREDICT_HIT        [port2]->read(), 1);
+		uint32_t k=  (_param->_size_queue[i]-j)%_param->_size_queue[i];
+		TEST(Tptr_t    , out_PREDICT_INDEX      [port2]->read(), k);
+
+		Taddress_t res = (0x89abcdef+((k==0)?(_param->_size_queue[i]-1):(k-1)));
+		LABEL("k      : %d",k);
+		LABEL("res    : %x",res);
+		LABEL("@_pop  : %x",out_PREDICT_ADDRESS_POP[port2]->read());
+
+		TEST(Taddress_t, out_PREDICT_ADDRESS_POP[port2]->read(),res);
+		
+		SC_START(1);
+	      }
+
+	    for (uint32_t j=0; j< _param->_size_queue[i]/2; j++)
+	      {
+		in_PREDICT_CONTEXT_ID   [port2]->write(i);
+		in_PREDICT_ADDRESS_PUSH [port2]->write(0xbabedead);
+		
+		SC_START(0);
+		
+		TEST(Tcontrol_t, out_PREDICT_ACK        [port2]->read(), 1);
+		TEST(Tcontrol_t, out_PREDICT_HIT        [port2]->read(), 1);
+		uint32_t k=(_param->_size_queue[i]/2-j)%_param->_size_queue[i];
+		TEST(Tptr_t    , out_PREDICT_INDEX      [port2]->read(), k);
+
+		Taddress_t res = (0x01234567+((k==0)?(_param->_size_queue[i]/2-1):(k-1)));
+
+		LABEL("k      : %d",k);
+		LABEL("res    : %x",res);
+		LABEL("@_pop  : %x",out_PREDICT_ADDRESS_POP[port2]->read());
+
+		TEST(Taddress_t, out_PREDICT_ADDRESS_POP[port2]->read(),res);
+		
+		SC_START(1);
+	      }
+	  }
+
+	in_PREDICT_VAL [port2]->write(0);
+
+	in_DECOD_VAL  [port1]->write(1);
+	in_DECOD_PUSH [port1]->write(0);
+	in_DECOD_MISS_PREDICTION [port1]->write(0);
+
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  {
+	    for (uint32_t j=0; j< _param->_size_queue[i]/2; j++)
+	      {
+		in_DECOD_CONTEXT_ID   [port1]->write(i);
+		in_DECOD_ADDRESS_PUSH [port1]->write(0xbabedead);
+		
+		SC_START(0);
+		
+		TEST(Tcontrol_t, out_DECOD_ACK        [port1]->read(), 1);
+		TEST(Tcontrol_t, out_DECOD_HIT        [port1]->read(), 1);
+		uint32_t k=(_param->_size_queue[i]/2-j)%_param->_size_queue[i];
+		TEST(Tptr_t    , out_DECOD_INDEX      [port1]->read(), k);
+
+		Taddress_t res = (0x01234567+((k==0)?(_param->_size_queue[i]/2-1):(k-1)));
+
+		LABEL("k      : %d",k);
+		LABEL("res    : %x",res);
+		LABEL("@_pop  : %x",out_DECOD_ADDRESS_POP[port1]->read());
+
+		TEST(Taddress_t, out_DECOD_ADDRESS_POP[port1]->read(),res);
+		
+		SC_START(1);
+	      }
+	  }
+
+	in_DECOD_VAL [port1]->write(0);
+
+      }
     }
 
@@ -195,4 +466,6 @@
   delete []  in_UPDATE_INDEX         ;
   delete []  in_UPDATE_ADDRESS       ;
+  delete []  in_UPDATE_MISS_PREDICTION;
+  delete []  in_UPDATE_PREDICTION_IFETCH;
 
 #endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/include/Return_Address_Stack.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/include/Return_Address_Stack.h	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/include/Return_Address_Stack.h	(revision 81)
@@ -84,11 +84,12 @@
 
     // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  public    : SC_IN (Tcontrol_t)           **  in_UPDATE_VAL            ; //[nb_inst_update]
-  public    : SC_OUT(Tcontrol_t)           ** out_UPDATE_ACK            ; //[nb_inst_update]
-  public    : SC_IN (Tcontext_t)           **  in_UPDATE_CONTEXT_ID     ; //[nb_inst_update] 
-  public    : SC_IN (Tcontrol_t)           **  in_UPDATE_PUSH           ; //[nb_inst_update]  1 = push, else pop
-  public    : SC_IN (Taddress_t)           **  in_UPDATE_ADDRESS        ; //[nb_inst_update]
-  public    : SC_IN (Tptr_t    )           **  in_UPDATE_INDEX          ; //[nb_inst_update]
-  public    : SC_IN (Tcontrol_t)           **  in_UPDATE_MISS_PREDICTION; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t)           **  in_UPDATE_VAL              ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t)           ** out_UPDATE_ACK              ; //[nb_inst_update]
+  public    : SC_IN (Tcontext_t)           **  in_UPDATE_CONTEXT_ID       ; //[nb_inst_update] 
+  public    : SC_IN (Tcontrol_t)           **  in_UPDATE_PUSH             ; //[nb_inst_update]  1 = push, else pop
+  public    : SC_IN (Taddress_t)           **  in_UPDATE_ADDRESS          ; //[nb_inst_update]
+  public    : SC_IN (Tptr_t    )           **  in_UPDATE_INDEX            ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t)           **  in_UPDATE_MISS_PREDICTION  ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t)           **  in_UPDATE_PREDICTION_IFETCH; //[nb_inst_update] // prediction only ifetch
 
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -98,8 +99,8 @@
   private   : Tptr_t                        * reg_TOP           ; //[nb_context]
   private   : Tptr_t                        * reg_BOTTOM        ; //[nb_context]
-  private   : Tcontrol_t                    * reg_EMPTY         ; //[nb_context]
+  private   : Tptr_t                        * reg_NB_ELT        ; //[nb_context]
   private   : Tptr_t                        * reg_PREDICT_TOP   ; //[nb_context]
   private   : Tptr_t                        * reg_PREDICT_BOTTOM; //[nb_context]
-  private   : Tcontrol_t                    * reg_PREDICT_EMPTY ; //[nb_context]
+  private   : Tptr_t                        * reg_PREDICT_NB_ELT; //[nb_context]
 
     // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -143,5 +144,5 @@
   public  : void        transition                (void);
   public  : void        genMealy_predict          (void);
-//   public  : void        genMealy_decod            (void);
+  public  : void        genMealy_decod            (void);
 //   public  : void        genMealy_update           (void);
 #endif					       
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack.cpp	(revision 81)
@@ -94,4 +94,34 @@
 # endif    
 
+	log_printf(INFO,Return_Address_Stack,FUNCTION,"Method - genMealy_decod");
+
+	SC_METHOD (genMealy_decod);
+	dont_initialize ();
+	sensitive << (*(in_CLOCK)).neg(); // use internal registers
+	for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
+	  {
+	    if (_param->_have_port_context_id)
+	    sensitive << (*( in_DECOD_CONTEXT_ID [i])); 
+	    sensitive << (*( in_DECOD_PUSH       [i]));
+	  }
+
+# ifdef SYSTEMCASS_SPECIFIC
+	// List dependency information
+	for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
+	  {
+	    if (_param->_have_port_context_id)
+	    (*(out_DECOD_HIT         [i])) (*( in_DECOD_CONTEXT_ID [i]));
+	    (*(out_DECOD_HIT         [i])) (*( in_DECOD_PUSH       [i]));
+
+	    if (_param->_have_port_context_id)
+	    (*(out_DECOD_ADDRESS_POP [i])) (*( in_DECOD_CONTEXT_ID [i]));
+	    (*(out_DECOD_ADDRESS_POP [i])) (*( in_DECOD_PUSH       [i]));
+
+	    if (_param->_have_port_context_id)
+	    (*(out_DECOD_INDEX       [i])) (*( in_DECOD_CONTEXT_ID [i]));
+	    (*(out_DECOD_INDEX       [i])) (*( in_DECOD_PUSH       [i]));
+	  }
+# endif
+
 	log_printf(INFO,Return_Address_Stack,FUNCTION,"Method - genMealy_predict");
 
@@ -122,5 +152,5 @@
 	    (*(out_PREDICT_INDEX       [i])) (*( in_PREDICT_PUSH       [i]));
 	  }
-# endif    
+# endif
 #endif
       }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_allocation.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_allocation.cpp	(revision 81)
@@ -96,4 +96,5 @@
       ALLOC1_SIGNAL_IN ( in_UPDATE_INDEX          ,"index"          ,Tptr_t    ,_param->_size_index);
       ALLOC1_SIGNAL_IN ( in_UPDATE_MISS_PREDICTION,"miss_prediction",Tcontrol_t,1);
+      ALLOC1_SIGNAL_IN ( in_UPDATE_PREDICTION_IFETCH,"prediction_ifetch",Tcontrol_t,1);
     }
 
@@ -106,9 +107,9 @@
     reg_TOP              = new Tptr_t     [_param->_nb_context];
     reg_BOTTOM           = new Tptr_t     [_param->_nb_context];
-    reg_EMPTY            = new Tcontrol_t [_param->_nb_context];
+    reg_NB_ELT           = new Tptr_t     [_param->_nb_context];
 
     reg_PREDICT_TOP      = new Tptr_t     [_param->_nb_context];
     reg_PREDICT_BOTTOM   = new Tptr_t     [_param->_nb_context];
-    reg_PREDICT_EMPTY    = new Tcontrol_t [_param->_nb_context];
+    reg_PREDICT_NB_ELT   = new Tptr_t     [_param->_nb_context];
 
     internal_PREDICT_ACK = new Tcontrol_t [_param->_nb_inst_predict];
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_deallocation.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_deallocation.cpp	(revision 81)
@@ -1,3 +1,3 @@
-*/*
+/*
  * $Id$
  *
@@ -54,4 +54,6 @@
 	delete []  in_UPDATE_INDEX         ;
 	delete []  in_UPDATE_ADDRESS       ;
+	delete []  in_UPDATE_MISS_PREDICTION;
+	delete []  in_UPDATE_PREDICTION_IFETCH;
       }
 
@@ -61,8 +63,8 @@
     delete [] reg_TOP;
     delete [] reg_BOTTOM;
-    delete [] reg_EMPTY;
+    delete [] reg_NB_ELT;
     delete [] reg_PREDICT_TOP;
     delete [] reg_PREDICT_BOTTOM;
-    delete [] reg_PREDICT_EMPTY;
+    delete [] reg_PREDICT_NB_ELT;
     
     delete [] internal_PREDICT_ACK;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_genMealy_decod.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_genMealy_decod.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_genMealy_decod.cpp	(revision 81)
@@ -48,5 +48,6 @@
 	// if push : value is hit
 	// if pop  : val and not miss
-	internal_DECOD_HIT [i] = (push or (reg_stack[context][top]._val and not reg_stack[context][top]._miss));
+	//   when the predictor : if hit = 0, wait (is not accurate)
+	internal_DECOD_HIT [i] = (push or (reg_stack[context][top]._val and not reg_stack[context][top]._miss and (reg_NB_ELT[context]>0)));
 	PORT_WRITE(out_DECOD_HIT         [i], internal_DECOD_HIT [i]);
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_genMealy_predict.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_genMealy_predict.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_genMealy_predict.cpp	(revision 81)
@@ -48,5 +48,5 @@
 	// if push : value is hit
 	// if pop  : val and not miss
-	internal_PREDICT_HIT [i] = (push or (reg_stack[context][top]._val and not reg_stack[context][top]._miss));
+	internal_PREDICT_HIT [i] = (push or (reg_stack[context][top]._val and not reg_stack[context][top]._miss and (reg_PREDICT_NB_ELT[context]>0)));
 	PORT_WRITE(out_PREDICT_HIT         [i], internal_PREDICT_HIT [i]);
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_transition.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_transition.cpp	(revision 81)
@@ -24,5 +24,5 @@
     log_printf(FUNC,Return_Address_Stack,FUNCTION,"Begin");
 
-    if (PORT_READ(in_NRESET))
+    if (PORT_READ(in_NRESET)==0)
       {
 	for (uint32_t i=0; i<_param->_nb_context; i++)
@@ -30,10 +30,16 @@
 	    reg_TOP    [i] = 0;
 	    reg_BOTTOM [i] = 0;
+	    reg_NB_ELT [i] = 0;
 
 	    reg_PREDICT_TOP    [i] = 0;
 	    reg_PREDICT_BOTTOM [i] = 0;
+	    reg_PREDICT_NB_ELT [i] = 0;
 
 	    for (uint32_t j=0; j<_param->_size_queue [i]; j++)
-	      reg_stack[i][j]._val = false;
+	      {
+		reg_stack[i][j]._val     = false;
+		reg_stack[i][j]._predict = false;
+		reg_stack[i][j]._miss    = false;
+	      }
 	  }
       }
@@ -46,29 +52,45 @@
 	  if (PORT_READ(in_PREDICT_VAL [i]) and internal_PREDICT_ACK [i])
 	    {
-	      Tcontrol_t context = (_param->_have_port_context_id)?PORT_READ(in_PREDICT_CONTEXT_ID [i]):0;
-	      Tcontrol_t push    = PORT_READ(in_PREDICT_PUSH [i]);
-	      Tptr_t     top_old = reg_PREDICT_TOP [i];
-	      Tptr_t     top_new;
-
+	      log_printf(TRACE,Return_Address_Stack,FUNCTION,"PREDICT[%d] : Transaction",i);
+	      Tcontext_t context    = (_param->_have_port_context_id)?PORT_READ(in_PREDICT_CONTEXT_ID [i]):0;
+	      Tcontrol_t push       = PORT_READ(in_PREDICT_PUSH [i]);
+	      Tptr_t     top_old    = reg_PREDICT_TOP    [context];
+	      Tptr_t     top_new    = top_old;
+	      Tptr_t     bottom_old = reg_PREDICT_BOTTOM [context];
+
+	      log_printf(TRACE,Return_Address_Stack,FUNCTION," * context : %d",context);
+
+	      // Hit  : push or (val and not miss and not empty)
+	      // Miss : ifetch is stall, no update
 	      if (internal_PREDICT_HIT [i])
 		{
+		  log_printf(TRACE,Return_Address_Stack,FUNCTION," * before");
+		  log_printf(TRACE,Return_Address_Stack,FUNCTION,"   * reg_predict_top     : %d",reg_PREDICT_TOP    [context]);
+		  log_printf(TRACE,Return_Address_Stack,FUNCTION,"   * reg_predict_bottom  : %d",reg_PREDICT_BOTTOM [context]);
+		  log_printf(TRACE,Return_Address_Stack,FUNCTION,"   * reg_predict_nb_elt  : %d",reg_PREDICT_NB_ELT [context]);
+
 		  if (push)
 		    {
-		      // push
+		      // push : increase the top (circular)
 		      top_new = (top_old+1)%_param->_size_queue[context];
 		      
 		      reg_stack [context][top_new]._val     = true; // New addr
-		      reg_stack [context][top_new]._predict = true; // Is speculative (erase a old addr)
+		      reg_stack [context][top_new]._predict = true; // Is speculative (erase a old addr (or not))
 		    //reg_stack [context][top_new]._miss    = ;
 		      reg_stack [context][top_new]._address = PORT_READ(in_PREDICT_ADDRESS_PUSH [i]);
 
 		      // the stack is full, erase the most old stack
-		      if (top_new == reg_PREDICT_BOTTOM [i])
-			reg_PREDICT_BOTTOM [i] = (reg_PREDICT_BOTTOM [i]+1)%_param->_size_queue[context];
+
+		      // Test if full
+		      if (reg_PREDICT_NB_ELT[context]==_param->_size_queue[context])
+			reg_PREDICT_BOTTOM [context] = (bottom_old+1)%_param->_size_queue[context];
+		      // A new data is write : the stack is not empty
+		      if (reg_PREDICT_NB_ELT[context]< _param->_size_queue[context])
+			reg_PREDICT_NB_ELT[context]++;
 		    }
 		  else
 		    {
 		      // pop
-		      top_new = (top_old==0)?(_param->_size_queue[context]-1):(top_old-1);
+// 		      top_new = (top_old==0)?(_param->_size_queue[context]-1):(top_old-1);
 		      
 		    //reg_stack [context][top_new]._val     = ;
@@ -78,71 +100,104 @@
 
 		      // the stack is empty
-		      if (top_old == reg_PREDICT_BOTTOM [i])
-			reg_PREDICT_BOTTOM [i] = top_new;
-
+		      if (reg_PREDICT_NB_ELT[context]>0)
+			{
+			  top_new = (top_old==0)?(_param->_size_queue[context]-1):(top_old-1);
+			  reg_PREDICT_NB_ELT[context] --;
+			}
 		    }
 		  
-		  reg_PREDICT_TOP [i] = top_new;
+		  reg_PREDICT_TOP [context] = top_new;
+
+		  log_printf(TRACE,Return_Address_Stack,FUNCTION," * after");
+		  log_printf(TRACE,Return_Address_Stack,FUNCTION,"   * reg_predict_top     : %d",reg_PREDICT_TOP    [context]);
+		  log_printf(TRACE,Return_Address_Stack,FUNCTION,"   * reg_predict_bottom  : %d",reg_PREDICT_BOTTOM [context]);
+		  log_printf(TRACE,Return_Address_Stack,FUNCTION,"   * reg_predict_nb_elt  : %d",reg_PREDICT_NB_ELT [context]);
 		}
 	    }
 
-// 	// ===================================================================
-// 	// =====[ DECOD ]=====================================================
-// 	// ===================================================================
-// 	for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
-// 	  if (PORT_READ(in_DECOD_VAL [i]) and internal_DECOD_ACK [i])
-// 	    {
-// 	      Tcontrol_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0;
-// 	      Tcontrol_t push    = PORT_READ(in_DECOD_PUSH [i]);
-// 	      Tptr_t     top_old = reg_TOP [i];
-// 	      Tptr_t     top_new;
-
-// 	      Tcontrol_t hit  = PORT_READ(in_DECOD_HIT             [i]);
-// 	      Tcontrol_t miss = PORT_READ(in_DECOD_MISS_PREDICTION [i]);
-
-// 	      if (push)
-// 		{
-// 		  // push
-// 		  top_new = (top_old+1)%_param->_size_queue[context];
-
-// 		  reg_stack [context][top_new]._val     = true;
-// 		  reg_stack [context][top_new]._predict = false;
-// 		  reg_stack [context][top_new]._miss    = false;
-// 		  reg_stack [context][top_new]._address = PORT_READ(in_DECOD_ADDRESS_PUSH [i]);
-
-// 		  // the stack is full, erase the most old stack
-// 		  if (top_old == reg_BOTTOM [i])
-// 		    reg_BOTTOM [i] = top_new;
-// 		}
-// 	      else
-// 		{
-// 		  // pop
+	// ===================================================================
+	// =====[ DECOD ]=====================================================
+	// ===================================================================
+	for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
+	  if (PORT_READ(in_DECOD_VAL [i]) and internal_DECOD_ACK [i])
+	    {
+	      log_printf(TRACE,Return_Address_Stack,FUNCTION,"DECOD[%d] : Transaction",i);
+	      Tcontext_t context    = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0;
+	      Tcontrol_t push       = PORT_READ(in_DECOD_PUSH [i]);
+	      Tptr_t     top_old    = reg_TOP    [context];
+	      Tptr_t     top_new    = top_old;
+	      Tptr_t     bottom_old = reg_BOTTOM [context];
+	      //Tcontrol_t hit        = internal_DECOD_HIT [i];
+	      Tcontrol_t miss       = PORT_READ(in_DECOD_MISS_PREDICTION [i]);
+
+	      log_printf(TRACE,Return_Address_Stack,FUNCTION," * context : %d",context);
+
+	      log_printf(TRACE,Return_Address_Stack,FUNCTION," * before");
+	      log_printf(TRACE,Return_Address_Stack,FUNCTION,"   * reg_top     : %d",reg_TOP    [context]);
+	      log_printf(TRACE,Return_Address_Stack,FUNCTION,"   * reg_bottom  : %d",reg_BOTTOM [context]);
+	      log_printf(TRACE,Return_Address_Stack,FUNCTION,"   * reg_nb_elt  : %d",reg_NB_ELT [context]);
+
+	      if (push)
+		{
+		  // push : increase the top (circular)
+		  top_new = (top_old+1)%_param->_size_queue[context];
+		  
+		  reg_stack [context][top_new]._val     = true;  // New address
+		  reg_stack [context][top_new]._predict = false; // No speculative
+		  reg_stack [context][top_new]._miss    = false;
+		  reg_stack [context][top_new]._address = PORT_READ(in_DECOD_ADDRESS_PUSH [i]);
+		  
+		  // Test if full : if true, then icrease the bottom (erase the most old stack)
+		  if (reg_NB_ELT[context]==_param->_size_queue[context])
+		    reg_BOTTOM [context] = (bottom_old+1)%_param->_size_queue[context];
+		  // A new data is write : the stack is not empty
+		  if (reg_NB_ELT[context]< _param->_size_queue[context])
+		    reg_NB_ELT[context]++;
+		}
+	      else
+		{
+		  // pop
 // 		  top_new = (top_old==0)?(_param->_size_queue[context]-1):(top_old-1);
 
-// 		//reg_stack [context][top_new]._val     = ;
-// 		//reg_stack [context][top_new]._predict = ;
-// 		//reg_stack [context][top_new]._miss    = ;
-// 		//reg_stack [context][top_new]._address = ; 
-// 		}
-
-// 	      reg_TOP [i] = top_new;
-
-// 	      // have previous miss of ifetch ?
-// 	      // 2 miss : 
-// 	      //   1) miss predict : is very limited (local at context), can be update very quickly
-// 	      //   2) miss decod   : result is in commit stage ... 
-// 	      if (miss)
-// 		{
-// 		  reg_PREDICT_BOTTOM [i] = reg_BOTTOM [i];
-// 		  reg_PREDICT_TOP    [i] = reg_TOP    [i];
-
-// 		  for (uint32_t j=0; j<_param->_size_queue [i]; j++)
-// 		    if (reg_stack [context][top_new]._predict)
-// 		      {
-// 			reg_stack [context][top_new]._predict = false;
-// 			reg_stack [context][top_new]._miss    = true;
-// 		      }
-// 		}
-// 	    }
+		  //reg_stack [context][top_new]._val     = ;
+		  //reg_stack [context][top_new]._predict = ;
+		  //reg_stack [context][top_new]._miss    = ;
+		  //reg_stack [context][top_new]._address = ; 
+		  
+		  // the stack is empty
+		  if (reg_NB_ELT[context]>0)
+		    {
+		      top_new = (top_old==0)?(_param->_size_queue[context]-1):(top_old-1);
+		      reg_NB_ELT[context] --;
+		    }
+		}
+	      
+	      reg_TOP [context] = top_new;
+	      
+	      log_printf(TRACE,Return_Address_Stack,FUNCTION," * after");
+	      log_printf(TRACE,Return_Address_Stack,FUNCTION,"   * reg_top     : %d",reg_TOP    [context]);
+	      log_printf(TRACE,Return_Address_Stack,FUNCTION,"   * reg_bottom  : %d",reg_BOTTOM [context]);
+	      log_printf(TRACE,Return_Address_Stack,FUNCTION,"   * reg_nb_elt  : %d",reg_NB_ELT [context]);
+
+	      // have previous miss of ifetch ?
+	      // 2 miss : 
+	      //   1) miss predict : is very limited (local at context), can be update very quickly
+	      //   2) miss decod   : result is in commit stage ... 
+	      if (miss)
+		{
+		  reg_PREDICT_BOTTOM [context] = reg_BOTTOM [context];
+		  reg_PREDICT_TOP    [context] = reg_TOP    [context];
+		  reg_PREDICT_NB_ELT [context] = reg_NB_ELT [context];
+		  
+		  // Scan full assoc !!!
+		  for (uint32_t j=0; j<_param->_size_queue [i]; j++)
+		    // Test if this slot is tagged with "predict" : if true, tagged as miss
+		    if (reg_stack [context][j]._predict)
+		      {
+			reg_stack [context][j]._predict = false;
+			reg_stack [context][j]._miss    = true;
+		      }
+		}
+	    }
 
 	// ===================================================================
@@ -152,32 +207,39 @@
 	  if (PORT_READ(in_UPDATE_VAL [i]) and internal_UPDATE_ACK [i])
 	    {
-	      Tcontrol_t context = (_param->_have_port_context_id)?PORT_READ(in_UPDATE_CONTEXT_ID [i]):0;
-	      Tcontrol_t push    = PORT_READ(in_UPDATE_PUSH  [i]);
-	      Tptr_t     index   = PORT_READ(in_UPDATE_INDEX [i]);
+	      ERRORMORPHEO(FUNCTION,"Fonction à implémenter !!!!!!!!!!!!");
 	      
-	      if (PORT_READ(in_UPDATE_MISS_PREDICTION [i]))
-		{
-		  if (push)
-		    {
-		      // push
-		      top_new = (top_old+1)%_param->_size_queue[context];
+
+// 	      Tcontrol_t miss   = PORT_READ(in_UPDATE_MISS_PREDICTION [i]);
+// 	      // 
+// 	      if (miss)
+// 		{
+// 		  Tcontrol_t context = (_param->_have_port_context_id)?PORT_READ(in_UPDATE_CONTEXT_ID [i]):0;
+// 		  Tcontrol_t ifetch  = PORT_READ(in_UPDATE_PREDICTION_IFETCH [i]);
+// 		  Tcontrol_t push    = PORT_READ(in_UPDATE_PUSH             [i]);
+// 		  Tptr_t     index   = PORT_READ(in_UPDATE_INDEX            [i]);
+// 		  Taddress_t address = PORT_READ(in_UPDATE_ADDRESS          [i]);
+		  
+// 		  if (push)
+// 		    {
+// // 		      // push
+// // 		      top_new = (top_old+1)%_param->_size_queue[context];
 		      
-		      reg_stack [context][index]._val     = true;
-		      reg_stack [context][index]._predict = false;
-		      reg_stack [context][index]._miss    = false;
-		      reg_stack [context][index]._address = PORT_READ(in_UPDATE_ADDRESS [i]);
-
-		    }
-		  else
-		    {
-		    //reg_stack [context][top_new]._val     = ;
-		    //reg_stack [context][top_new]._predict = ;
-		    //reg_stack [context][top_new]._miss    = ;
-		    //reg_stack [context][top_new]._address = ; 
-		    }
-		  
-		  // Mouais bof .......
-		  reg_PREDICT_TOP [i] = index;
-		}
+// // 		      reg_stack [context][index]._val     = true;
+// // 		      reg_stack [context][index]._predict = false;
+// // 		      reg_stack [context][index]._miss    = false;
+// // 		      reg_stack [context][index]._address = PORT_READ(in_UPDATE_ADDRESS [i]);
+
+// 		    }
+// 		  else
+// 		    {
+// // 		    //reg_stack [context][top_new]._val     = ;
+// // 		    //reg_stack [context][top_new]._predict = ;
+// // 		    //reg_stack [context][top_new]._miss    = ;
+// // 		    //reg_stack [context][top_new]._address = ; 
+// 		    }
+		  
+// // // 		  // Mouais bof .......
+// // // 		  reg_PREDICT_TOP [context] = index;
+// 		}
 	    }
       }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/SelfTest/src/test.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/SelfTest/src/test.cpp	(revision 81)
@@ -7,38 +7,10 @@
  */
 
+#define NB_ITERATION  1
+#define CYCLE_MAX     (128*NB_ITERATION)
+
 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/SelfTest/include/test.h"
 #include "Common/include/Test.h"
 #include "Behavioural/include/Allocation.h"
-
-#define NB_ITERATION  1
-#define CYCLE_MAX     (128*NB_ITERATION)
-
-#define LABEL(str...)							\
-  {									\
-    msg (_("{%d} "),static_cast<uint32_t>(sc_simulation_time()));	\
-    msg (str);								\
-    msg (_("\n"));							\
-  } while(0)
-
-#define SC_START(cycle_offset)                                                       \
-  do									             \
-    {									             \
-      /*cout << "SC_START (begin)" << endl;*/				             \
-									             \
-      uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time());          \
-      if (cycle_offset != 0)						             \
-	{								             \
-	  cout << "##########[ cycle "<< cycle_current+cycle_offset << " ]" << endl; \
-	}								             \
-									             \
-      if (cycle_current > CYCLE_MAX)					             \
-	{								             \
-	  TEST_KO("Maximal cycles Reached");				             \
-	}								             \
-									             \
-      sc_start(cycle_offset);						             \
-									             \
-      /*cout << "SC_START (end  )" << endl;*/				             \
-    } while(0)
 
 void test (string name,
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/config_mono_context.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/config_mono_context.cfg	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/config_mono_context.cfg	(revision 81)
@@ -0,0 +1,10 @@
+Update_Prediction_Table
+1	1	+1	# nb_context             
+1	4	*4	# size_queue             [0] [nb_context]
+32	32	*2	# size_address           
+4	4	*4	# nb_inst_predict        
+4	4	*4	# nb_inst_decod          
+4	4	*4	# nb_inst_branch_complete
+4	4	*4	# nb_inst_update         
+0	0	+1	# size_history           
+3	3	*2	# size_ras_index         [0] [nb_context]
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/config_multi_context.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/config_multi_context.cfg	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/config_multi_context.cfg	(revision 81)
@@ -0,0 +1,16 @@
+Update_Prediction_Table
+4	4	+1	# nb_context             
+4	4	*4	# size_queue             [0] [nb_context]
+1	1	*4	# size_queue             [1] [nb_context]
+8	8	*4	# size_queue             [2] [nb_context]
+2	2	*4	# size_queue             [3] [nb_context]
+32	32	*2	# size_address           
+4	4	*4	# nb_inst_predict        
+4	4	*4	# nb_inst_decod          
+4	4	*4	# nb_inst_branch_complete
+4	4	*4	# nb_inst_update         
+0	0	+1	# size_history           
+3	3	*2	# size_ras_index         [0] [nb_context]
+1	1	*2	# size_ras_index         [1] [nb_context]
+2	2	*2	# size_ras_index         [2] [nb_context]
+8	8	*2	# size_ras_index         [3] [nb_context]
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/configuration.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/configuration.cfg	(revision 78)
+++ 	(revision )
@@ -1,1 +1,0 @@
-Update_Prediction_Table
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/main.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/main.cpp	(revision 81)
@@ -8,5 +8,5 @@
 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/include/test.h"
 
-#define NB_PARAMS 0
+#define NB_PARAMS 7
 
 void usage (int argc, char * argv[])
@@ -14,5 +14,13 @@
   err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
   err (_("list_params is :\n"));
-  err (_(" * ()\n"));
+  err (_(" * nb_context                           (uint32_t)\n"));
+  err (_(" * size_queue              [nb_context] (uint32_t)\n"));
+  err (_(" * size_address                         (uint32_t)\n"));
+  err (_(" * nb_inst_predict                      (uint32_t)\n"));
+  err (_(" * nb_inst_decod                        (uint32_t)\n"));
+  err (_(" * nb_inst_branch_complete              (uint32_t)\n"));
+  err (_(" * nb_inst_update                       (uint32_t)\n"));
+  err (_(" * size_history                         (uint32_t)\n"));
+  err (_(" * size_ras_index          [nb_context] (uint32_t)\n"));
 
   exit (1);
@@ -25,5 +33,5 @@
 #endif
 {
-  if (argc != static_cast<int>(2+NB_PARAMS))
+  if (argc <= static_cast<int>(2+NB_PARAMS))
     usage (argc, argv);
 
@@ -31,6 +39,22 @@
 
   string name = argv[x++];
-//const uint32_t size_data = atoi(argv[x++]);
-//const uint32_t nb_port   = atoi(argv[x++]);
+
+  uint32_t   _nb_context              = fromString<uint32_t>(argv[x++]);
+
+  if (argc != static_cast<int>(2+NB_PARAMS+2*_nb_context))
+    usage (argc, argv);
+
+  uint32_t * _size_queue              = new uint32_t [_nb_context];
+  for (uint32_t i=0; i<_nb_context; i++)
+    _size_queue [i] = fromString<uint32_t>(argv[x++]);
+  uint32_t   _size_address            = fromString<uint32_t>(argv[x++]);
+  uint32_t   _nb_inst_predict         = fromString<uint32_t>(argv[x++]);
+  uint32_t   _nb_inst_decod           = fromString<uint32_t>(argv[x++]);
+  uint32_t   _nb_inst_branch_complete = fromString<uint32_t>(argv[x++]);
+  uint32_t   _nb_inst_update          = fromString<uint32_t>(argv[x++]);
+  uint32_t   _size_history            = fromString<uint32_t>(argv[x++]);
+  uint32_t * _size_ras_index          = new uint32_t [_nb_context];
+  for (uint32_t i=0; i<_nb_context; i++)
+    _size_ras_index [i] = fromString<uint32_t>(argv[x++]);
 
   int _return = EXIT_SUCCESS;
@@ -38,7 +62,13 @@
     {
       morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::Parameters
-	(//size_data,
-	 //nb_port  
-        );
+	(_nb_context             ,
+	 _size_queue             ,
+	 _size_address           ,
+	 _nb_inst_predict        ,
+	 _nb_inst_decod          ,
+	 _nb_inst_branch_complete,
+	 _nb_inst_update         ,
+	 _size_history           ,
+	 _size_ras_index         );
       
       msg(_("%s"),param->print(1).c_str());
@@ -57,4 +87,8 @@
     }
 
+
+  delete [] _size_ras_index;
+  delete [] _size_queue;
+
   return (_return);
 }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp	(revision 81)
@@ -7,38 +7,10 @@
  */
 
+#define NB_ITERATION  8
+#define CYCLE_MAX     (128*NB_ITERATION)
+
 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/include/test.h"
 #include "Common/include/Test.h"
 #include "Behavioural/include/Allocation.h"
-
-#define NB_ITERATION  1
-#define CYCLE_MAX     (128*NB_ITERATION)
-
-#define LABEL(str...)							\
-  {									\
-    msg (_("{%d} "),static_cast<uint32_t>(sc_simulation_time()));	\
-    msg (str);								\
-    msg (_("\n"));							\
-  } while(0)
-
-#define SC_START(cycle_offset)                                                       \
-  do									             \
-    {									             \
-      /*cout << "SC_START (begin)" << endl;*/				             \
-									             \
-      uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time());          \
-      if (cycle_offset != 0)						             \
-	{								             \
-	  cout << "##########[ cycle "<< cycle_current+cycle_offset << " ]" << endl; \
-	}								             \
-									             \
-      if (cycle_current > CYCLE_MAX)					             \
-	{								             \
-	  TEST_KO("Maximal cycles Reached");				             \
-	}								             \
-									             \
-      sc_start(cycle_offset);						             \
-									             \
-      /*cout << "SC_START (end  )" << endl;*/				             \
-    } while(0)
 
 void test (string name,
@@ -51,9 +23,21 @@
 #endif
 
-  Update_Prediction_Table * _Update_Prediction_Table = new Update_Prediction_Table (name.c_str(),
+  Tusage_t _usage = USE_ALL;
+
+//   _usage = usage_unset(_usage,USE_SYSTEMC              );
+//   _usage = usage_unset(_usage,USE_VHDL                 );
+//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
+//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
+//   _usage = usage_unset(_usage,USE_POSITION             );
+//   _usage = usage_unset(_usage,USE_STATISTICS           );
+//   _usage = usage_unset(_usage,USE_INFORMATION          );
+    
+  Update_Prediction_Table * _Update_Prediction_Table = new Update_Prediction_Table 
+    (name.c_str(),
 #ifdef STATISTICS
-					     _parameters_statistics,
+     _parameters_statistics,
 #endif
-					     _param);
+     _param,
+     _usage);
   
 #ifdef SYSTEMC
@@ -65,4 +49,56 @@
   sc_clock              *  in_CLOCK  = new sc_clock ("clock", 1.0, 0.5);	 
   sc_signal<Tcontrol_t> *  in_NRESET = new sc_signal<Tcontrol_t> ("NRESET");
+
+  ALLOC1_SC_SIGNAL( in_PREDICT_VAL                    ," in_PREDICT_VAL                    ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL(out_PREDICT_ACK                    ,"out_PREDICT_ACK                    ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_CONTEXT_ID             ," in_PREDICT_CONTEXT_ID             ",Tcontext_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_BTB_ADDRESS_SRC        ," in_PREDICT_BTB_ADDRESS_SRC        ",Taddress_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_BTB_ADDRESS_DEST       ," in_PREDICT_BTB_ADDRESS_DEST       ",Taddress_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_BTB_CONDITION          ," in_PREDICT_BTB_CONDITION          ",Tbranch_condition_t,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_BTB_LAST_TAKE          ," in_PREDICT_BTB_LAST_TAKE          ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_BTB_IS_ACCURATE        ," in_PREDICT_BTB_IS_ACCURATE        ",Tcontrol_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_DIR_HISTORY            ," in_PREDICT_DIR_HISTORY            ",Thistory_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_RAS_ADDRESS            ," in_PREDICT_RAS_ADDRESS            ",Taddress_t         ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_PREDICT_RAS_INDEX              ," in_PREDICT_RAS_INDEX              ",Tptr_t             ,_param->_nb_inst_predict);
+//ALLOC1_SC_SIGNAL(out_PREDICT_UPDATE_PREDICTION_ID   ,"out_PREDICT_UPDATE_PREDICTION_ID   ",Tprediction_ptr_t  ,_param->_nb_inst_predict);
+  ALLOC1_SC_SIGNAL( in_DECOD_VAL                      ," in_DECOD_VAL                      ",Tcontrol_t         ,_param->_nb_inst_decod);
+  ALLOC1_SC_SIGNAL(out_DECOD_ACK                      ,"out_DECOD_ACK                      ",Tcontrol_t         ,_param->_nb_inst_decod);
+  ALLOC1_SC_SIGNAL( in_DECOD_CONTEXT_ID               ," in_DECOD_CONTEXT_ID               ",Tcontext_t         ,_param->_nb_inst_decod);
+  ALLOC1_SC_SIGNAL( in_DECOD_BTB_ADDRESS_SRC          ," in_DECOD_BTB_ADDRESS_SRC          ",Taddress_t         ,_param->_nb_inst_decod);
+  ALLOC1_SC_SIGNAL( in_DECOD_BTB_ADDRESS_DEST         ," in_DECOD_BTB_ADDRESS_DEST         ",Taddress_t         ,_param->_nb_inst_decod);
+  ALLOC1_SC_SIGNAL( in_DECOD_BTB_CONDITION            ," in_DECOD_BTB_CONDITION            ",Tbranch_condition_t,_param->_nb_inst_decod);
+  ALLOC1_SC_SIGNAL( in_DECOD_BTB_LAST_TAKE            ," in_DECOD_BTB_LAST_TAKE            ",Tcontrol_t         ,_param->_nb_inst_decod);
+  ALLOC1_SC_SIGNAL( in_DECOD_RAS_ADDRESS              ," in_DECOD_RAS_ADDRESS              ",Taddress_t         ,_param->_nb_inst_decod);
+  ALLOC1_SC_SIGNAL( in_DECOD_RAS_INDEX                ," in_DECOD_RAS_INDEX                ",Tptr_t             ,_param->_nb_inst_decod);
+  ALLOC1_SC_SIGNAL( in_DECOD_MISS_PREDICTION          ," in_DECOD_MISS_PREDICTION          ",Tcontrol_t         ,_param->_nb_inst_decod);
+  ALLOC1_SC_SIGNAL( in_DECOD_UPDATE_PREDICTION_ID     ," in_DECOD_UPDATE_PREDICTION_ID     ",Tprediction_ptr_t  ,_param->_nb_inst_decod);
+//ALLOC1_SC_SIGNAL(out_DECOD_DEPTH                    ,"out_DECOD_DEPTH                    ",Tdepth_t           ,_param->_nb_inst_decod);
+  ALLOC1_SC_SIGNAL( in_BRANCH_COMPLETE_VAL            ," in_BRANCH_COMPLETE_VAL            ",Tcontrol_t         ,_param->_nb_inst_branch_complete);
+  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_ACK            ,"out_BRANCH_COMPLETE_ACK            ",Tcontrol_t         ,_param->_nb_inst_branch_complete);
+  ALLOC1_SC_SIGNAL( in_BRANCH_COMPLETE_CONTEXT_ID     ," in_BRANCH_COMPLETE_CONTEXT_ID     ",Tcontext_t         ,_param->_nb_inst_branch_complete);
+  ALLOC1_SC_SIGNAL( in_BRANCH_COMPLETE_DEPTH          ," in_BRANCH_COMPLETE_DEPTH          ",Tdepth_t           ,_param->_nb_inst_branch_complete);
+  ALLOC1_SC_SIGNAL( in_BRANCH_COMPLETE_ADDRESS        ," in_BRANCH_COMPLETE_ADDRESS        ",Taddress_t         ,_param->_nb_inst_branch_complete);
+  ALLOC1_SC_SIGNAL( in_BRANCH_COMPLETE_FLAG           ," in_BRANCH_COMPLETE_FLAG           ",Tcontrol_t         ,_param->_nb_inst_branch_complete);
+  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_MISS_PREDICTION,"out_BRANCH_COMPLETE_MISS_PREDICTION",Tcontrol_t         ,_param->_nb_inst_branch_complete);
+  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_TAKE           ,"out_BRANCH_COMPLETE_TAKE           ",Tcontrol_t         ,_param->_nb_inst_branch_complete);
+  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_SRC    ,"out_BRANCH_COMPLETE_ADDRESS_SRC    ",Taddress_t         ,_param->_nb_inst_branch_complete);
+  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_DEST   ,"out_BRANCH_COMPLETE_ADDRESS_DEST   ",Taddress_t         ,_param->_nb_inst_branch_complete);
+  ALLOC1_SC_SIGNAL(out_UPDATE_VAL                     ,"out_UPDATE_VAL                     ",Tcontrol_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL( in_UPDATE_ACK                     ," in_UPDATE_ACK                     ",Tcontrol_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_CONTEXT_ID              ,"out_UPDATE_CONTEXT_ID              ",Tcontext_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_MISS_PREDICTION         ,"out_UPDATE_MISS_PREDICTION         ",Tcontrol_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_DIRECTION_GOOD          ,"out_UPDATE_DIRECTION_GOOD          ",Tcontrol_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_BTB_VAL                 ,"out_UPDATE_BTB_VAL                 ",Tcontrol_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_BTB_ADDRESS_SRC         ,"out_UPDATE_BTB_ADDRESS_SRC         ",Taddress_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_BTB_ADDRESS_DEST        ,"out_UPDATE_BTB_ADDRESS_DEST        ",Taddress_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_BTB_CONDITION           ,"out_UPDATE_BTB_CONDITION           ",Tbranch_condition_t,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_DIR_VAL                 ,"out_UPDATE_DIR_VAL                 ",Tcontrol_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_DIR_HISTORY             ,"out_UPDATE_DIR_HISTORY             ",Thistory_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_RAS_VAL                 ,"out_UPDATE_RAS_VAL                 ",Tcontrol_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_RAS_ADDRESS             ,"out_UPDATE_RAS_ADDRESS             ",Taddress_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_RAS_INDEX               ,"out_UPDATE_RAS_INDEX               ",Tptr_t             ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_RAS_PREDICTION_IFETCH   ,"out_UPDATE_RAS_PREDICTION_IFETCH   ",Tcontrol_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_DEPTH_NB_BRANCH                ,"out_DEPTH_NB_BRANCH                ",Tdepth_t           ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL(out_DEPTH_TAIL                     ,"out_DEPTH_TAIL                     ",Tdepth_t           ,_param->_nb_context);
   
   /********************************************************
@@ -75,4 +111,67 @@
   (*(_Update_Prediction_Table->in_NRESET))       (*(in_NRESET));
 
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_PREDICT_VAL                    ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_PREDICT_ACK                    ,_param->_nb_inst_predict);
+  if (_param->_have_port_context_id)
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_PREDICT_CONTEXT_ID             ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_PREDICT_BTB_ADDRESS_SRC        ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_PREDICT_BTB_ADDRESS_DEST       ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_PREDICT_BTB_CONDITION          ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_PREDICT_BTB_LAST_TAKE          ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_PREDICT_BTB_IS_ACCURATE        ,_param->_nb_inst_predict);
+  if (_param->_have_port_history)
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_PREDICT_DIR_HISTORY            ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_PREDICT_RAS_ADDRESS            ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_PREDICT_RAS_INDEX              ,_param->_nb_inst_predict);
+//if (_param->_have_port_depth)
+//INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_PREDICT_UPDATE_PREDICTION_ID   ,_param->_nb_inst_predict);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_VAL                      ,_param->_nb_inst_decod);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DECOD_ACK                      ,_param->_nb_inst_decod);
+  if (_param->_have_port_context_id)
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_CONTEXT_ID               ,_param->_nb_inst_decod);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_BTB_ADDRESS_SRC          ,_param->_nb_inst_decod);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_BTB_ADDRESS_DEST         ,_param->_nb_inst_decod);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_BTB_CONDITION            ,_param->_nb_inst_decod);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_BTB_LAST_TAKE            ,_param->_nb_inst_decod);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_RAS_ADDRESS              ,_param->_nb_inst_decod);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_RAS_INDEX                ,_param->_nb_inst_decod);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_MISS_PREDICTION          ,_param->_nb_inst_decod);
+  if (_param->_have_port_depth)
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_UPDATE_PREDICTION_ID     ,_param->_nb_inst_decod);
+//if (_param->_have_port_depth)
+//INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DECOD_DEPTH                    ,_param->_nb_inst_decod);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_COMPLETE_VAL            ,_param->_nb_inst_branch_complete);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_BRANCH_COMPLETE_ACK            ,_param->_nb_inst_branch_complete);
+  if (_param->_have_port_context_id)
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_COMPLETE_CONTEXT_ID     ,_param->_nb_inst_branch_complete);
+  if (_param->_have_port_depth)
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_COMPLETE_DEPTH          ,_param->_nb_inst_branch_complete);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_COMPLETE_ADDRESS        ,_param->_nb_inst_branch_complete);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_COMPLETE_FLAG           ,_param->_nb_inst_branch_complete);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_BRANCH_COMPLETE_MISS_PREDICTION,_param->_nb_inst_branch_complete);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_BRANCH_COMPLETE_TAKE           ,_param->_nb_inst_branch_complete);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_BRANCH_COMPLETE_ADDRESS_SRC    ,_param->_nb_inst_branch_complete);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_BRANCH_COMPLETE_ADDRESS_DEST   ,_param->_nb_inst_branch_complete);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_VAL                     ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_UPDATE_ACK                     ,_param->_nb_inst_update);
+  if (_param->_have_port_context_id)
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_CONTEXT_ID              ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_MISS_PREDICTION         ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_DIRECTION_GOOD          ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_BTB_VAL                 ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_BTB_ADDRESS_SRC         ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_BTB_ADDRESS_DEST        ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_BTB_CONDITION           ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_DIR_VAL                 ,_param->_nb_inst_update);
+  if (_param->_have_port_history)
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_DIR_HISTORY             ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_VAL                 ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_ADDRESS             ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_INDEX               ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_PREDICTION_IFETCH   ,_param->_nb_inst_update);
+  if (_param->_have_port_depth)
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_NB_BRANCH                ,_param->_nb_context);
+  if (_param->_have_port_depth)
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_TAIL                     ,_param->_nb_context);
 
   msg(_("<%s> : Start Simulation ............\n"),name.c_str());
@@ -90,4 +189,9 @@
 
   srand(seed);
+
+  const  int32_t percent_transaction_predict         = 75;
+  const  int32_t percent_transaction_decod           = 75;
+  const  int32_t percent_transaction_branch_complete = 75;
+  const  int32_t percent_transaction_update          = 75;
 
   SC_START(0);
@@ -104,6 +208,429 @@
     {
       LABEL("Iteration %d",iteration);
-
+      
+      {
+	uint32_t context = rand() % _param->_nb_context;
+	
+// 	LABEL("KANE : %d",context);
+
+	LABEL("PREDICT - fill the queue");
+	
+	{
+	  uint32_t port = rand() % _param->_nb_inst_predict;
+	  
+	  for (uint32_t i=0; i<_param->_size_queue[context]; i++)
+	    {
+	      
+	      bool find = false;
+	      do
+		{
+		  in_PREDICT_VAL              [port]->write((rand()%100)<percent_transaction_predict);
+		  in_PREDICT_CONTEXT_ID       [port]->write(context);
+		  in_PREDICT_BTB_ADDRESS_SRC  [port]->write(0xdeadbeef+i);
+		  in_PREDICT_BTB_ADDRESS_DEST [port]->write(0x21071981+i);
+		  in_PREDICT_BTB_CONDITION    [port]->write(BRANCH_CONDITION_FLAG_SET);
+		  in_PREDICT_BTB_LAST_TAKE    [port]->write(1);
+		  in_PREDICT_BTB_IS_ACCURATE  [port]->write((rand()%100)<percent_transaction_predict);
+		  in_PREDICT_DIR_HISTORY      [port]->write(i);
+		  in_PREDICT_RAS_ADDRESS      [port]->write(0xdeaddead+i);
+		  in_PREDICT_RAS_INDEX        [port]->write((0x12345678+i)%_param->_size_ras_index[context]);
+		  
+		  if (_param->_have_port_depth)
+		    {
+		      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
+		      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), i);
+		    }
+		  SC_START(0);
+		  
+		  LABEL("PREDICT         [%d] %d - %d (accurate : %d).",port,in_PREDICT_VAL [port]->read(),out_PREDICT_ACK [port]->read(), in_PREDICT_BTB_IS_ACCURATE [port]->read());
+		  
+		  if (in_PREDICT_VAL [port]->read() and out_PREDICT_ACK [port]->read())
+		    {
+		      LABEL("PREDICT         [%d] - Transaction accepted",port);
+		      find = true;
+		    }
+		  
+		  SC_START(1);
+		  
+		} while (not find);
+	      in_PREDICT_VAL              [port]->write(0);
+	      
+	      if (_param->_have_port_depth)
+		{
+		  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
+		  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), i+1);
+		}
+	    }
+	}
+	
+	LABEL("DECOD - hit ifetch");
+	
+	{
+	  uint32_t port = rand() % _param->_nb_inst_decod;
+	  
+	  for (uint32_t i=0; i<_param->_size_queue[context]; i++)
+	    {
+	      
+	      bool find = false;
+	      do
+		{
+		  in_DECOD_VAL                  [port]->write((rand()%100)<percent_transaction_decod);
+		  in_DECOD_CONTEXT_ID           [port]->write(context);
+		  in_DECOD_BTB_ADDRESS_SRC      [port]->write(0xdeadbeef+i);
+		  in_DECOD_BTB_ADDRESS_DEST     [port]->write(0x21071981+i);
+		  in_DECOD_BTB_CONDITION        [port]->write(BRANCH_CONDITION_FLAG_SET);
+		  in_DECOD_BTB_LAST_TAKE        [port]->write(1);
+		  in_DECOD_RAS_ADDRESS          [port]->write(0xdeaddead+i);
+		  in_DECOD_RAS_INDEX            [port]->write((0x12345678+i)%_param->_size_ras_index[context]);
+		  in_DECOD_MISS_PREDICTION      [port]->write(false);
+		  in_DECOD_UPDATE_PREDICTION_ID [port]->write(i);
+		  
+		  if (_param->_have_port_depth)
+		    {
+		      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
+		      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
+		    }
+		  
+		  SC_START(0);
+		  
+		  LABEL("DECOD           [%d] %d - %d.",port,in_DECOD_VAL [port]->read(),out_DECOD_ACK [port]->read());
+		  
+		  if (in_DECOD_VAL [port]->read() and out_DECOD_ACK [port]->read())
+		    {
+		      LABEL("DECOD           [%d] - Transaction accepted",port);
+		      find = true;
+		    }
+		  
+		  SC_START(1);
+		  
+		} while (not find);
+	      in_DECOD_VAL              [port]->write(0);
+	      
+	      if (_param->_have_port_depth)
+		{
+		  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
+		  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
+		}
+	    }
+	}
+	
+	LABEL("BRANCH_COMPLETE - hit ifetch");
+	
+	{
+	  uint32_t port = rand() % _param->_nb_inst_branch_complete;
+	  
+	  for (uint32_t i=0; i<_param->_size_queue[context]; i++)
+	    {
+	      bool find = false;
+	      do
+		{
+		  in_BRANCH_COMPLETE_VAL                  [port]->write((rand()%100)<percent_transaction_branch_complete);
+		  in_BRANCH_COMPLETE_CONTEXT_ID           [port]->write(context);
+		  in_BRANCH_COMPLETE_DEPTH                [port]->write(i);
+		  in_BRANCH_COMPLETE_ADDRESS              [port]->write(0xcacacaca+i);
+		  in_BRANCH_COMPLETE_FLAG                 [port]->write(1);
+		  
+		  if (_param->_have_port_depth)
+		    {
+		      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
+		      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
+		    }
+		  
+		  SC_START(0);
+		  
+		  LABEL("BRANCH_COMPLETE [%d] %d - %d.",port,in_BRANCH_COMPLETE_VAL [port]->read(),out_BRANCH_COMPLETE_ACK [port]->read());
+		  
+		  if (in_BRANCH_COMPLETE_VAL [port]->read() and out_BRANCH_COMPLETE_ACK [port]->read())
+		    {
+		      LABEL("BRANCH_COMPLETE [%d] - Transaction accepted",port);
+		      find = true;
+		      
+		      TEST(Tcontrol_t,out_BRANCH_COMPLETE_MISS_PREDICTION[port]->read(),0);
+		      TEST(Tcontrol_t,out_BRANCH_COMPLETE_TAKE           [port]->read(),1);
+		      TEST(Taddress_t,out_BRANCH_COMPLETE_ADDRESS_SRC    [port]->read(),0xdeadbeef+i);
+		      TEST(Taddress_t,out_BRANCH_COMPLETE_ADDRESS_DEST   [port]->read(),0x21071981+i);
+		    }
+		  
+		  SC_START(1);
+
+		} while (not find);
+	      in_BRANCH_COMPLETE_VAL              [port]->write(0);
+	      
+	      if (_param->_have_port_depth)
+		{
+		  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
+		  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
+		}
+	    }
+	}
+	
+	LABEL("UPDATE - hit ifetch");
+	
+	{
+	  uint32_t port = 0; //rand() % _param->_nb_inst_update;
+	  
+	  for (uint32_t i=0; i<_param->_size_queue[context]; i++)
+	    {
+	      bool find = false;
+	      do
+		{
+		  in_UPDATE_ACK [port]->write((rand()%100)<percent_transaction_update);
+		  
+		  SC_START(0);
+		  
+		  if (out_UPDATE_VAL [port]->read() and in_UPDATE_ACK [port]->read())
+		    {
+		      LABEL("UPDATE [%d] - Transaction accepted",port);
+		      
+		      find = true;
+		      
+		      TEST(Tcontext_t         ,out_UPDATE_CONTEXT_ID            [port]->read(), context);
+		      TEST(Tcontrol_t         ,out_UPDATE_MISS_PREDICTION       [port]->read(), 0);
+		      TEST(Tcontrol_t         ,out_UPDATE_DIRECTION_GOOD        [port]->read(), 1);
+		      TEST(Tcontrol_t         ,out_UPDATE_BTB_VAL               [port]->read(), 1);
+		      TEST(Taddress_t         ,out_UPDATE_BTB_ADDRESS_SRC       [port]->read(), 0xdeadbeef+i);
+		      TEST(Taddress_t         ,out_UPDATE_BTB_ADDRESS_DEST      [port]->read(), 0x21071981+i);	      
+		      TEST(Tbranch_condition_t,out_UPDATE_BTB_CONDITION         [port]->read(), BRANCH_CONDITION_FLAG_SET);
+		      TEST(Tcontrol_t         ,out_UPDATE_DIR_VAL               [port]->read(), 1);
+		      if (_param->_have_port_history)
+			TEST(Thistory_t         ,out_UPDATE_DIR_HISTORY           [port]->read(), i);
+		      TEST(Tcontrol_t         ,out_UPDATE_RAS_VAL               [port]->read(), 0);
+		      TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(), 0xdeaddead+i);
+		      TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(), (0x12345678+i)%_param->_size_ras_index[context]);
+		      TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [port]->read(), 1);
+		    }
+		  
+		  SC_START(1);
+		  
+		} while (not find);
+	      in_UPDATE_ACK              [port]->write(0);
+	    }
+	  
+	  LABEL("Wait a moment");
+	  SC_START(2*_param->_size_queue[context]);
+  
+	  // wait the garbage collector
+	  if (_param->_have_port_depth)
+	    while ((out_DEPTH_TAIL     [context]->read() != 0) and
+		   (out_DEPTH_NB_BRANCH[context]->read() != 0))
+	      {
+		LABEL("DEPTH [%d] nb_branch : %d - tail : %d",context,out_DEPTH_NB_BRANCH[context]->read(), out_DEPTH_TAIL [context]->read());
+		SC_START(1);
+	      }
+	}
+      }
+
+      {
+	uint32_t context = rand() % _param->_nb_context;
+	
+// 	LABEL("KANE : %d",context);
+
+	LABEL("PREDICT - fill the queue");
+	
+	{
+	  uint32_t port = rand() % _param->_nb_inst_predict;
+	  
+	  for (uint32_t i=0; i<_param->_size_queue[context]; i++)
+	    {
+	      
+	      bool find = false;
+	      do
+		{
+		  in_PREDICT_VAL              [port]->write((rand()%100)<percent_transaction_predict);
+		  in_PREDICT_CONTEXT_ID       [port]->write(context);
+		  in_PREDICT_BTB_ADDRESS_SRC  [port]->write(0xdeadbeef+i);
+		  in_PREDICT_BTB_ADDRESS_DEST [port]->write(0x21071981+i);
+		  in_PREDICT_BTB_CONDITION    [port]->write(BRANCH_CONDITION_FLAG_SET);
+		  in_PREDICT_BTB_LAST_TAKE    [port]->write(1);
+		  in_PREDICT_BTB_IS_ACCURATE  [port]->write((rand()%100)<percent_transaction_predict);
+		  in_PREDICT_DIR_HISTORY      [port]->write(i);
+		  in_PREDICT_RAS_ADDRESS      [port]->write(0xdeaddead+i);
+		  in_PREDICT_RAS_INDEX        [port]->write((0x12345678+i)%_param->_size_ras_index[context]);
+		  
+		  if (_param->_have_port_depth)
+		    {
+		      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
+		      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), i);
+		    }
+		  SC_START(0);
+		  
+		  LABEL("PREDICT         [%d] %d - %d (accurate : %d).",port,in_PREDICT_VAL [port]->read(),out_PREDICT_ACK [port]->read(), in_PREDICT_BTB_IS_ACCURATE [port]->read());
+		  
+		  if (in_PREDICT_VAL [port]->read() and out_PREDICT_ACK [port]->read())
+		    {
+		      LABEL("PREDICT         [%d] - Transaction accepted",port);
+		      find = true;
+		    }
+		  
+		  SC_START(1);
+		  
+		} while (not find);
+	      in_PREDICT_VAL              [port]->write(0);
+	      
+	      if (_param->_have_port_depth)
+		{
+		  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
+		  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), i+1);
+		}
+	    }
+	}
+	
+	LABEL("DECOD - hit ifetch");
+	
+	{
+	  uint32_t port = rand() % _param->_nb_inst_decod;
+	  
+	  for (uint32_t i=0; i<_param->_size_queue[context]; i++)
+	    {
+	      
+	      bool find = false;
+	      do
+		{
+		  in_DECOD_VAL                  [port]->write((rand()%100)<percent_transaction_decod);
+		  in_DECOD_CONTEXT_ID           [port]->write(context);
+		  in_DECOD_BTB_ADDRESS_SRC      [port]->write(0xdeadbeef+i);
+		  in_DECOD_BTB_ADDRESS_DEST     [port]->write(0x21071981+i);
+		  in_DECOD_BTB_CONDITION        [port]->write(BRANCH_CONDITION_FLAG_SET);
+		  in_DECOD_BTB_LAST_TAKE        [port]->write(1);
+		  in_DECOD_RAS_ADDRESS          [port]->write(0xdeaddead+i);
+		  in_DECOD_RAS_INDEX            [port]->write((0x12345678+i)%_param->_size_ras_index[context]);
+		  in_DECOD_MISS_PREDICTION      [port]->write(false);
+		  in_DECOD_UPDATE_PREDICTION_ID [port]->write(i);
+		  
+		  if (_param->_have_port_depth)
+		    {
+		      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
+		      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
+		    }
+		  
+		  SC_START(0);
+		  
+		  LABEL("DECOD           [%d] %d - %d.",port,in_DECOD_VAL [port]->read(),out_DECOD_ACK [port]->read());
+		  
+		  if (in_DECOD_VAL [port]->read() and out_DECOD_ACK [port]->read())
+		    {
+		      LABEL("DECOD           [%d] - Transaction accepted",port);
+		      find = true;
+		    }
+		  
+		  SC_START(1);
+		  
+		} while (not find);
+	      in_DECOD_VAL              [port]->write(0);
+	      
+	      if (_param->_have_port_depth)
+		{
+		  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
+		  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
+		}
+	    }
+	}
+	
+	LABEL("BRANCH_COMPLETE - hit ifetch");
+	
+	{
+	  uint32_t port = rand() % _param->_nb_inst_branch_complete;
+	  
+	    {
+	      uint32_t i=0;
+	      bool find = false;
+	      do
+		{
+		  in_BRANCH_COMPLETE_VAL                  [port]->write((rand()%100)<percent_transaction_branch_complete);
+		  in_BRANCH_COMPLETE_CONTEXT_ID           [port]->write(context);
+		  in_BRANCH_COMPLETE_DEPTH                [port]->write(i);
+		  in_BRANCH_COMPLETE_ADDRESS              [port]->write(0xcacacaca+i);
+		  in_BRANCH_COMPLETE_FLAG                 [port]->write(0);
+		  
+		  if (_param->_have_port_depth)
+		    {
+		      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
+		      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
+		    }
+		  
+		  SC_START(0);
+		  
+		  LABEL("BRANCH_COMPLETE [%d] %d - %d.",port,in_BRANCH_COMPLETE_VAL [port]->read(),out_BRANCH_COMPLETE_ACK [port]->read());
+		  
+		  if (in_BRANCH_COMPLETE_VAL [port]->read() and out_BRANCH_COMPLETE_ACK [port]->read())
+		    {
+		      LABEL("BRANCH_COMPLETE [%d] - Transaction accepted",port);
+		      find = true;
+		      
+		      TEST(Tcontrol_t,out_BRANCH_COMPLETE_MISS_PREDICTION[port]->read(),1);
+		      TEST(Tcontrol_t,out_BRANCH_COMPLETE_TAKE           [port]->read(),0);
+		      TEST(Taddress_t,out_BRANCH_COMPLETE_ADDRESS_SRC    [port]->read(),0xdeadbeef+i);
+		      TEST(Taddress_t,out_BRANCH_COMPLETE_ADDRESS_DEST   [port]->read(),0x21071981+i);
+		    }
+		  
+		  SC_START(1);
+
+		} while (not find);
+	      in_BRANCH_COMPLETE_VAL              [port]->write(0);
+	    }
+	}
+	
+	LABEL("UPDATE - miss ifetch");
+	
+	{
+	  uint32_t port = 0; //rand() % _param->_nb_inst_update;
+	  
+// 	  for (uint32_t i=0; i<_param->_size_queue[context]; i++)
+	    {
+	      uint32_t i=0;
+
+	      bool find = false;
+	      do
+		{
+		  in_UPDATE_ACK [port]->write((rand()%100)<percent_transaction_update);
+		  
+		  SC_START(0);
+		  
+		  if (out_UPDATE_VAL [port]->read() and in_UPDATE_ACK [port]->read())
+		    {
+		      LABEL("UPDATE [%d] - Transaction accepted",port);
+		      
+		      find = true;
+		      
+		      TEST(Tcontext_t         ,out_UPDATE_CONTEXT_ID            [port]->read(), context);
+		      TEST(Tcontrol_t         ,out_UPDATE_MISS_PREDICTION       [port]->read(), 1);
+		      TEST(Tcontrol_t         ,out_UPDATE_DIRECTION_GOOD        [port]->read(), 0);
+		      TEST(Tcontrol_t         ,out_UPDATE_BTB_VAL               [port]->read(), 1);
+		      TEST(Taddress_t         ,out_UPDATE_BTB_ADDRESS_SRC       [port]->read(), 0xdeadbeef+i);
+		      TEST(Taddress_t         ,out_UPDATE_BTB_ADDRESS_DEST      [port]->read(), 0x21071981+i);	      
+		      TEST(Tbranch_condition_t,out_UPDATE_BTB_CONDITION         [port]->read(), BRANCH_CONDITION_FLAG_SET);
+		      TEST(Tcontrol_t         ,out_UPDATE_DIR_VAL               [port]->read(), 1);
+		      if (_param->_have_port_history)
+			TEST(Thistory_t         ,out_UPDATE_DIR_HISTORY           [port]->read(), i);
+		      TEST(Tcontrol_t         ,out_UPDATE_RAS_VAL               [port]->read(), 0);
+		      TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(), 0xdeaddead+i);
+		      TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(), (0x12345678+i)%_param->_size_ras_index[context]);
+		      TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [port]->read(), 1);
+		    }
+		  
+		  SC_START(1);
+		  
+		} while (not find);
+	      in_UPDATE_ACK              [port]->write(0);
+	    }
+	    
+	    LABEL("Wait a moment");
+	    SC_START(_param->_size_queue[context]);
+	    
+	    // wait the garbage collector
+	    if (_param->_have_port_depth)
+	      while ((out_DEPTH_TAIL     [context]->read() != 0) and
+		     (out_DEPTH_NB_BRANCH[context]->read() != 0))
+		{
+		  LABEL("DEPTH [%d] nb_branch : %d - tail : %d",context,out_DEPTH_NB_BRANCH[context]->read(), out_DEPTH_TAIL [context]->read());
+		  SC_START(1);
+		}
+	}
+      }
+
+      LABEL ("Yo1");
       SC_START(1);
+      LABEL ("Yo2");
+
     }
 
@@ -119,4 +646,66 @@
   delete in_CLOCK;
   delete in_NRESET;
+
+  // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  delete []  in_PREDICT_VAL                 ;
+  delete [] out_PREDICT_ACK                 ;
+  delete []  in_PREDICT_CONTEXT_ID          ;
+  delete []  in_PREDICT_BTB_ADDRESS_SRC     ;
+  delete []  in_PREDICT_BTB_ADDRESS_DEST    ;
+  delete []  in_PREDICT_BTB_CONDITION       ;
+  delete []  in_PREDICT_BTB_LAST_TAKE       ;
+  delete []  in_PREDICT_BTB_IS_ACCURATE     ;
+  delete []  in_PREDICT_DIR_HISTORY         ;
+  delete []  in_PREDICT_RAS_ADDRESS         ;
+  delete []  in_PREDICT_RAS_INDEX           ;
+//delete [] out_PREDICT_UPDATE_PREDICTION_ID;
+  
+  // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  delete []  in_DECOD_VAL                   ;
+  delete [] out_DECOD_ACK                   ;
+  delete []  in_DECOD_CONTEXT_ID            ;
+  delete []  in_DECOD_BTB_ADDRESS_SRC       ;
+  delete []  in_DECOD_BTB_ADDRESS_DEST      ;
+  delete []  in_DECOD_BTB_CONDITION         ;
+  delete []  in_DECOD_BTB_LAST_TAKE         ;
+  delete []  in_DECOD_RAS_ADDRESS           ;
+  delete []  in_DECOD_RAS_INDEX             ;
+  delete []  in_DECOD_MISS_PREDICTION       ;
+  delete []  in_DECOD_UPDATE_PREDICTION_ID  ;
+//delete [] out_DECOD_DEPTH                 ;
+  
+  // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  delete []  in_BRANCH_COMPLETE_VAL            ;
+  delete [] out_BRANCH_COMPLETE_ACK            ;
+  delete []  in_BRANCH_COMPLETE_CONTEXT_ID     ;
+  delete []  in_BRANCH_COMPLETE_DEPTH          ;
+  delete []  in_BRANCH_COMPLETE_ADDRESS        ;
+  delete []  in_BRANCH_COMPLETE_FLAG           ;
+  delete [] out_BRANCH_COMPLETE_MISS_PREDICTION;
+  delete [] out_BRANCH_COMPLETE_TAKE           ;
+  delete [] out_BRANCH_COMPLETE_ADDRESS_SRC    ;
+  delete [] out_BRANCH_COMPLETE_ADDRESS_DEST   ;
+  
+  // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  delete [] out_UPDATE_VAL                  ;
+  delete []  in_UPDATE_ACK                  ;
+  delete [] out_UPDATE_CONTEXT_ID           ;
+  delete [] out_UPDATE_MISS_PREDICTION      ;
+  delete [] out_UPDATE_DIRECTION_GOOD       ;
+  delete [] out_UPDATE_BTB_VAL              ;
+  delete [] out_UPDATE_BTB_ADDRESS_SRC      ;
+  delete [] out_UPDATE_BTB_ADDRESS_DEST     ;
+  delete [] out_UPDATE_BTB_CONDITION        ;
+  delete [] out_UPDATE_DIR_VAL              ;
+  delete [] out_UPDATE_DIR_HISTORY          ;
+  delete [] out_UPDATE_RAS_VAL              ;
+  delete [] out_UPDATE_RAS_ADDRESS          ;
+  delete [] out_UPDATE_RAS_INDEX            ;
+  delete [] out_UPDATE_RAS_PREDICTION_IFETCH;
+
+  // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  delete [] out_DEPTH_NB_BRANCH;
+  delete [] out_DEPTH_TAIL;
+
 #endif
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Parameters.h	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Parameters.h	(revision 81)
@@ -24,8 +24,33 @@
   {
     //-----[ fields ]------------------------------------------------------------
+  public : uint32_t   _nb_context             ;
+  public : uint32_t * _size_queue             ; // [nb_context]
+  public : uint32_t   _size_address           ;
+  public : uint32_t   _nb_inst_predict        ;
+  public : uint32_t   _nb_inst_decod          ;
+  public : uint32_t   _nb_inst_branch_complete;
+  public : uint32_t   _nb_inst_update         ;
+  public : uint32_t   _size_history           ;
+  public : uint32_t * _size_ras_index         ; // [nb_context]
 
+  public : uint32_t   _size_context_id        ;
+  public : uint32_t   _size_depth             ;
+  public : uint32_t   _max_size_ras_index     ;
+		      
+  public : bool       _have_port_context_id   ;
+  public : bool       _have_port_depth        ;
+  public : bool       _have_port_history      ;
+    
     //-----[ methods ]-----------------------------------------------------------
-  public : Parameters  ();
-//   public : Parameters  (Parameters & param) ;
+  public : Parameters  (uint32_t   nb_context             ,
+			uint32_t * size_queue             ,
+			uint32_t   size_address           ,
+			uint32_t   nb_inst_predict        ,
+			uint32_t   nb_inst_decod          ,
+			uint32_t   nb_inst_branch_complete,
+			uint32_t   nb_inst_update         ,
+			uint32_t   size_history           ,
+			uint32_t * size_ras_index         );
+//public : Parameters  (Parameters & param) ;
   public : ~Parameters () ;
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h	(revision 81)
@@ -19,4 +19,27 @@
 namespace update_prediction_table {
 
+  typedef enum
+    {
+      UPDATE_PREDICTION_STATE_EMPTY      , // Slot is empty
+      UPDATE_PREDICTION_STATE_WAIT_DECOD , // Fetch have access at the predictor
+      UPDATE_PREDICTION_STATE_WAITEND    , // Have make a prediction, wait branch_complete
+      UPDATE_PREDICTION_STATE_OK         , // branch is complete and can update predictor
+      UPDATE_PREDICTION_STATE_KO         , // have a event - must update predictor unit
+      UPDATE_PREDICTION_STATE_END          // branch is updated 
+    } state_t;
+
+  class entry_t
+  {
+  public : state_t             _state;
+  public : Tcontrol_t          _ifetch_prediction;
+  public : Tbranch_condition_t _condition;
+  public : Taddress_t          _address_src;
+  public : Taddress_t          _address_dest;
+  public : Tcontrol_t          _last_take;
+  public : Tcontrol_t          _good_take;
+  public : Thistory_t          _history;
+  public : Taddress_t          _address_ras;
+  public : Tptr_t              _index_ras;
+  };
 
 }; // end namespace update_prediction_table
@@ -25,6 +48,22 @@
 }; // end namespace multi_front_end
 }; // end namespace core
+}; // end namespace behavioural
+  
 
-}; // end namespace behavioural
+  template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::state_t& x)
+  {
+    switch (x)
+      {
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_EMPTY      : return "empty"     ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_WAIT_DECOD : return "wait_decod"; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_WAITEND    : return "waitend"   ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_OK         : return "ok"        ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_KO         : return "ko"        ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END        : return "end"       ; break;
+      default    : return ""      ; break;
+      }
+  };
+
+
 }; // end namespace morpheo              
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h	(revision 81)
@@ -62,9 +62,87 @@
   public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
 
+    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_VAL                 ; //[nb_inst_predict]
+  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_ACK                 ; //[nb_inst_predict]
+  public    : SC_IN (Tcontext_t         )  **  in_PREDICT_CONTEXT_ID          ; //[nb_inst_predict]
+  public    : SC_IN (Taddress_t         )  **  in_PREDICT_BTB_ADDRESS_SRC     ; //[nb_inst_predict]
+  public    : SC_IN (Taddress_t         )  **  in_PREDICT_BTB_ADDRESS_DEST    ; //[nb_inst_predict]
+  public    : SC_IN (Tbranch_condition_t)  **  in_PREDICT_BTB_CONDITION       ; //[nb_inst_predict]
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_BTB_LAST_TAKE       ; //[nb_inst_predict]
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_BTB_IS_ACCURATE     ; //[nb_inst_predict]
+  public    : SC_IN (Thistory_t         )  **  in_PREDICT_DIR_HISTORY         ; //[nb_inst_predict]
+  public    : SC_IN (Taddress_t         )  **  in_PREDICT_RAS_ADDRESS         ; //[nb_inst_predict]
+  public    : SC_IN (Tptr_t             )  **  in_PREDICT_RAS_INDEX           ; //[nb_inst_predict]
+//public    : SC_OUT(Tprediction_ptr_t  )  ** out_PREDICT_UPDATE_PREDICTION_ID; //[nb_inst_predict]
+
+    // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_VAL                   ; //[nb_inst_decod]
+  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_ACK                   ; //[nb_inst_decod]
+  public    : SC_IN (Tcontext_t         )  **  in_DECOD_CONTEXT_ID            ; //[nb_inst_decod]
+  public    : SC_IN (Taddress_t         )  **  in_DECOD_BTB_ADDRESS_SRC       ; //[nb_inst_decod]
+  public    : SC_IN (Taddress_t         )  **  in_DECOD_BTB_ADDRESS_DEST      ; //[nb_inst_decod]
+  public    : SC_IN (Tbranch_condition_t)  **  in_DECOD_BTB_CONDITION         ; //[nb_inst_decod]
+  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_BTB_LAST_TAKE         ; //[nb_inst_decod]
+//public    : SC_IN (Tcontrol_t         )  **  in_DECOD_BTB_IS_ACCURATE       ; //[nb_inst_decod]
+//public    : SC_IN (Thistory_t         )  **  in_DECOD_DIR_HISTORY           ; //[nb_inst_decod] // if ifetch prediction is miss -> miss btb -> make a static state
+  public    : SC_IN (Taddress_t         )  **  in_DECOD_RAS_ADDRESS           ; //[nb_inst_decod]
+  public    : SC_IN (Tptr_t             )  **  in_DECOD_RAS_INDEX             ; //[nb_inst_decod]
+  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_MISS_PREDICTION       ; //[nb_inst_decod] // ifetch is a miss pred
+  public    : SC_IN (Tprediction_ptr_t  )  **  in_DECOD_UPDATE_PREDICTION_ID  ; //[nb_inst_decod]
+//public    : SC_OUT(Tdepth_t           )  ** out_DECOD_DEPTH                 ; //[nb_inst_decod]
+
+    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  public    : SC_IN (Tcontrol_t         )  **  in_BRANCH_COMPLETE_VAL            ; //[nb_inst_branch_complete]
+  public    : SC_OUT(Tcontrol_t         )  ** out_BRANCH_COMPLETE_ACK            ; //[nb_inst_branch_complete]
+  public    : SC_IN (Tcontext_t         )  **  in_BRANCH_COMPLETE_CONTEXT_ID     ; //[nb_inst_branch_complete]
+  public    : SC_IN (Tdepth_t           )  **  in_BRANCH_COMPLETE_DEPTH          ; //[nb_inst_branch_complete]
+  public    : SC_IN (Taddress_t         )  **  in_BRANCH_COMPLETE_ADDRESS        ; //[nb_inst_branch_complete]
+  public    : SC_IN (Tcontrol_t         )  **  in_BRANCH_COMPLETE_FLAG           ; //[nb_inst_branch_complete]
+  public    : SC_OUT(Tcontrol_t         )  ** out_BRANCH_COMPLETE_MISS_PREDICTION; //[nb_inst_branch_complete]
+  public    : SC_OUT(Tcontrol_t         )  ** out_BRANCH_COMPLETE_TAKE           ; //[nb_inst_branch_complete]
+  public    : SC_OUT(Taddress_t         )  ** out_BRANCH_COMPLETE_ADDRESS_SRC    ; //[nb_inst_branch_complete]
+  public    : SC_OUT(Taddress_t         )  ** out_BRANCH_COMPLETE_ADDRESS_DEST   ; //[nb_inst_branch_complete]
+
+    // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_VAL                  ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t         )  **  in_UPDATE_ACK                  ; //[nb_inst_update]
+  public    : SC_OUT(Tcontext_t         )  ** out_UPDATE_CONTEXT_ID           ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_MISS_PREDICTION      ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_DIRECTION_GOOD       ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_BTB_VAL              ; //[nb_inst_update]
+  public    : SC_OUT(Taddress_t         )  ** out_UPDATE_BTB_ADDRESS_SRC      ; //[nb_inst_update]
+  public    : SC_OUT(Taddress_t         )  ** out_UPDATE_BTB_ADDRESS_DEST     ; //[nb_inst_update]
+  public    : SC_OUT(Tbranch_condition_t)  ** out_UPDATE_BTB_CONDITION        ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_DIR_VAL              ; //[nb_inst_update]
+  public    : SC_OUT(Thistory_t         )  ** out_UPDATE_DIR_HISTORY          ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_RAS_VAL              ; //[nb_inst_update]
+  public    : SC_OUT(Taddress_t         )  ** out_UPDATE_RAS_ADDRESS          ; //[nb_inst_update]
+  public    : SC_OUT(Tptr_t             )  ** out_UPDATE_RAS_INDEX            ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_RAS_PREDICTION_IFETCH; //[nb_inst_update]
+
+    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_NB_BRANCH; //[nb_context]
+  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_TAIL; //[nb_context]
+
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
 
     // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+  private   : uint32_t                      * reg_TOP                    ; //[nb_context]
+  private   : uint32_t                      * reg_BOTTOM                 ; //[nb_context]
+  private   : uint32_t                      * reg_NB_ELT                 ; //[nb_context]
+  private   : uint32_t                      * reg_NB_ELT_NEED_UPDATE     ; //[nb_context]
+  private   : entry_t                      ** reg_UPDATE_PREDICTION_TABLE; //[nb_context][size_queue]
+  private   : uint32_t                        reg_UPDATE_PRIORITY        ;
 
     // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  private   : Tcontrol_t                    * internal_PREDICT_ACK                    ; //[nb_inst_predict]
+  private   : Tcontrol_t                    * internal_DECOD_ACK                      ; //[nb_inst_decod]
+  private   : Tcontrol_t                    * internal_BRANCH_COMPLETE_ACK            ; //[nb_inst_branch_complete]
+  private   : Tcontrol_t                    * internal_BRANCH_COMPLETE_MISS_PREDICTION; //[nb_inst_branch_complete]
+  private   : Tcontrol_t                    * internal_BRANCH_COMPLETE_TAKE           ; //[nb_inst_branch_complete]
+  private   : Taddress_t                    * internal_BRANCH_COMPLETE_ADDRESS_DEST   ; //[nb_inst_branch_complete]
+  private   : Tcontrol_t                    * internal_UPDATE_VAL                     ; //[nb_inst_update]
+  private   : Tcontext_t                    * internal_UPDATE_CONTEXT_ID              ; //[nb_inst_update]
+  private   : Tdepth_t                      * internal_UPDATE_DEPTH                   ; //[nb_inst_update]
 #endif
 
@@ -85,5 +163,5 @@
 #endif
    Parameters                                  * param,
-   morpheo::behavioural::Tusage_t                usage=USE_ALL
+   morpheo::behavioural::Tusage_t                usage
    );
   public  :          ~Update_Prediction_Table             (void);
@@ -100,5 +178,9 @@
 #ifdef SYSTEMC				       
   public  : void        transition                (void);
-//public  : void        genMoore                  (void);
+  public  : void        genMoore                  (void);
+  public  : void        genMealy_predict          (void);
+  public  : void        genMealy_decod            (void);
+  public  : void        genMealy_branch_complete  (void);
+//public  : void        genMealy_update           (void);
 #endif					       
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Parameters.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Parameters.cpp	(revision 81)
@@ -7,4 +7,5 @@
 
 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Parameters.h"
+#include "Common/include/Max.h"
 
 namespace morpheo {
@@ -19,7 +20,34 @@
 #undef  FUNCTION
 #define FUNCTION "Update_Prediction_Table::Parameters"
-  Parameters::Parameters ()
+  Parameters::Parameters (uint32_t   nb_context             ,
+			  uint32_t * size_queue             ,
+			  uint32_t   size_address           ,
+			  uint32_t   nb_inst_predict        ,
+			  uint32_t   nb_inst_decod          ,
+			  uint32_t   nb_inst_branch_complete,
+			  uint32_t   nb_inst_update         ,
+			  uint32_t   size_history           ,
+			  uint32_t * size_ras_index         )
   {
     log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
+
+    _nb_context              = nb_context             ;
+    _size_queue              = size_queue             ;
+    _size_address            = size_address           ;
+    _nb_inst_predict         = nb_inst_predict        ;
+    _nb_inst_decod           = nb_inst_decod          ;
+    _nb_inst_branch_complete = nb_inst_branch_complete;
+    _nb_inst_update          = nb_inst_update         ;
+    _size_history            = size_history           ;
+    _size_ras_index          = size_ras_index         ;
+    
+    _size_context_id         = log2(nb_context);
+    _size_depth              = log2(max<uint32_t>(size_queue,nb_context));
+    _max_size_ras_index      = max<uint32_t>(_size_ras_index,nb_context);
+
+    _have_port_context_id    = _size_context_id> 0;
+    _have_port_depth         = _size_depth     > 0;
+    _have_port_history       = _size_history   > 0;
+    
     test();
     log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Parameters_msg_error.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Parameters_msg_error.cpp	(revision 81)
@@ -27,4 +27,7 @@
     Parameters_test test ("Update_Prediction_Table");
 
+    if (morpheo::behavioural::test<Tdepth_t>(_size_depth) == false)
+      test.error("type \"Tdepth_t\" is too small.");
+
     log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Parameters_print.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Parameters_print.cpp	(revision 81)
@@ -27,5 +27,21 @@
 
     xml.balise_open("update_prediction_table");
-//  xml.singleton_begin(""); xml.attribut("value",toString(_)); xml.singleton_end();
+    xml.singleton_begin("nb_context             "); xml.attribut("value",toString(_nb_context             )); xml.singleton_end();
+    xml.singleton_begin("size_address           "); xml.attribut("value",toString(_size_address           )); xml.singleton_end();
+    xml.singleton_begin("nb_inst_predict        "); xml.attribut("value",toString(_nb_inst_predict        )); xml.singleton_end();
+    xml.singleton_begin("nb_inst_decod          "); xml.attribut("value",toString(_nb_inst_decod          )); xml.singleton_end();
+    xml.singleton_begin("nb_inst_branch_complete"); xml.attribut("value",toString(_nb_inst_branch_complete)); xml.singleton_end();
+    xml.singleton_begin("nb_inst_update         "); xml.attribut("value",toString(_nb_inst_update         )); xml.singleton_end();
+    xml.singleton_begin("size_history           "); xml.attribut("value",toString(_size_history           )); xml.singleton_end();
+    for (uint32_t i=0;i<_nb_context; i++)
+      {
+        xml. balise_open_begin("component");
+        xml.  attribut("type","context");
+        xml.  attribut("id"  ,toString(i));
+        xml. balise_open_end();
+	xml.  singleton_begin("size_queue             "); xml.attribut("value",toString(_size_queue             [i])); xml.singleton_end();
+	xml.  singleton_begin("size_ras_index         "); xml.attribut("value",toString(_size_ras_index         [i])); xml.singleton_end();
+        xml. balise_close();
+      }
     xml.balise_close();
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table.cpp	(revision 81)
@@ -38,4 +38,6 @@
     log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
 
+    usage_environment(_usage);
+
     log_printf(INFO,Update_Prediction_Table,FUNCTION,"Allocation");
 
@@ -68,4 +70,11 @@
     if (_usage & USE_SYSTEMC)
       {
+
+	for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
+	  {
+	    internal_BRANCH_COMPLETE_ACK [i] = 1;
+	    PORT_WRITE(out_BRANCH_COMPLETE_ACK [i], internal_BRANCH_COMPLETE_ACK [i]);
+	  }
+
 	log_printf(INFO,Update_Prediction_Table,FUNCTION,"Method - transition");
 
@@ -76,4 +85,103 @@
 # ifdef SYSTEMCASS_SPECIFIC
 	// List dependency information
+# endif    
+
+	log_printf(INFO,Update_Prediction_Table,FUNCTION,"Method - genMoore");
+
+	SC_METHOD (genMoore);
+	dont_initialize ();
+	sensitive << (*(in_CLOCK)).neg();
+	
+# ifdef SYSTEMCASS_SPECIFIC
+	// List dependency information
+# endif    
+
+	log_printf(INFO,Update_Prediction_Table,FUNCTION,"Method - genMealy_predict");
+
+	SC_METHOD (genMealy_predict);
+	dont_initialize ();
+	sensitive << (*(in_CLOCK)).neg(); // use internal register
+	for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	  {
+	    if (_param->_have_port_context_id)
+	      sensitive << (*(in_PREDICT_CONTEXT_ID [i]));
+	    sensitive << (*(in_PREDICT_BTB_IS_ACCURATE [i]));
+	  }
+	
+# ifdef SYSTEMCASS_SPECIFIC
+	// List dependency information
+	for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	  {
+	    (*(out_PREDICT_ACK                  [i])) (*(in_PREDICT_BTB_IS_ACCURATE [i]));
+	    if (_param->_have_port_context_id)
+	    (*(out_PREDICT_ACK                  [i])) (*(in_PREDICT_CONTEXT_ID      [i]));
+	  }
+# endif    
+
+	log_printf(INFO,Update_Prediction_Table,FUNCTION,"Method - genMealy_decod");
+
+	SC_METHOD (genMealy_decod);
+	dont_initialize ();
+	sensitive << (*(in_CLOCK)).neg(); // use internal register
+	for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
+	  {
+	    if (_param->_have_port_context_id)
+	      sensitive << (*(in_DECOD_CONTEXT_ID [i]));
+	    sensitive << (*(in_DECOD_MISS_PREDICTION [i]));
+	  }
+	
+# ifdef SYSTEMCASS_SPECIFIC
+	// List dependency information
+	for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
+	  {
+	    (*(out_DECOD_ACK                  [i])) (*(in_DECOD_MISS_PREDICTION [i]));
+	    if (_param->_have_port_context_id)
+	    (*(out_DECOD_ACK                  [i])) (*(in_DECOD_CONTEXT_ID      [i]));
+	  }
+# endif    
+
+	log_printf(INFO,Update_Prediction_Table,FUNCTION,"Method - genMealy_branch_complete");
+
+	SC_METHOD (genMealy_branch_complete);
+	dont_initialize ();
+	sensitive << (*(in_CLOCK)).neg(); // use internal register
+	for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
+	  {
+	    if (_param->_have_port_context_id)
+	    sensitive << (*(in_BRANCH_COMPLETE_CONTEXT_ID [i]));
+	    if (_param->_have_port_depth)
+	    sensitive << (*(in_BRANCH_COMPLETE_DEPTH [i]));
+	    sensitive << (*(in_BRANCH_COMPLETE_FLAG    [i]))
+		      << (*(in_BRANCH_COMPLETE_ADDRESS [i]));
+	  }
+	
+# ifdef SYSTEMCASS_SPECIFIC
+	// List dependency information
+	for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
+	  {
+	    if (_param->_have_port_context_id)
+	    (*(out_BRANCH_COMPLETE_MISS_PREDICTION [i])) (*(in_BRANCH_COMPLETE_CONTEXT_ID [i]));
+	    if (_param->_have_port_depth)
+	    (*(out_BRANCH_COMPLETE_MISS_PREDICTION [i])) (*(in_BRANCH_COMPLETE_DEPTH      [i]));
+	    (*(out_BRANCH_COMPLETE_MISS_PREDICTION [i])) (*(in_BRANCH_COMPLETE_FLAG       [i]));
+	    (*(out_BRANCH_COMPLETE_MISS_PREDICTION [i])) (*(in_BRANCH_COMPLETE_ADDRESS    [i]));
+
+	    if (_param->_have_port_context_id)
+	    (*(out_BRANCH_COMPLETE_TAKE            [i])) (*(in_BRANCH_COMPLETE_CONTEXT_ID [i]));
+	    if (_param->_have_port_depth)
+	    (*(out_BRANCH_COMPLETE_TAKE            [i])) (*(in_BRANCH_COMPLETE_DEPTH      [i]));
+	    (*(out_BRANCH_COMPLETE_TAKE            [i])) (*(in_BRANCH_COMPLETE_FLAG       [i]));
+
+	    if (_param->_have_port_context_id)
+	    (*(out_BRANCH_COMPLETE_ADDRESS_SRC     [i])) (*(in_BRANCH_COMPLETE_CONTEXT_ID [i]));
+	    if (_param->_have_port_depth)
+	    (*(out_BRANCH_COMPLETE_ADDRESS_SRC     [i])) (*(in_BRANCH_COMPLETE_DEPTH      [i]));
+
+	    if (_param->_have_port_context_id)
+	    (*(out_BRANCH_COMPLETE_ADDRESS_DEST    [i])) (*(in_BRANCH_COMPLETE_CONTEXT_ID [i]));
+	    if (_param->_have_port_depth)
+	    (*(out_BRANCH_COMPLETE_ADDRESS_DEST    [i])) (*(in_BRANCH_COMPLETE_DEPTH      [i]));
+	    (*(out_BRANCH_COMPLETE_ADDRESS_DEST    [i])) (*(in_BRANCH_COMPLETE_ADDRESS    [i]));
+	  }
 # endif    
 	
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp	(revision 81)
@@ -55,4 +55,111 @@
       in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
     }
+
+    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      ALLOC1_INTERFACE("predict", IN,SOUTH, "predict", _param->_nb_inst_predict);
+      
+      ALLOC1_VALACK_IN ( in_PREDICT_VAL                 ,VAL);
+      ALLOC1_VALACK_OUT(out_PREDICT_ACK                 ,ACK);
+      ALLOC1_SIGNAL_IN ( in_PREDICT_CONTEXT_ID          ,"context_id"          ,Tcontext_t         ,_param->_size_context_id);
+      ALLOC1_SIGNAL_IN ( in_PREDICT_BTB_ADDRESS_SRC     ,"btb_address_src"     ,Taddress_t         ,_param->_size_address);
+      ALLOC1_SIGNAL_IN ( in_PREDICT_BTB_ADDRESS_DEST    ,"btb_address_dest"    ,Taddress_t         ,_param->_size_address);
+      ALLOC1_SIGNAL_IN ( in_PREDICT_BTB_CONDITION       ,"btb_condition"       ,Tbranch_condition_t,_param->_size_branch_condition);
+      ALLOC1_SIGNAL_IN ( in_PREDICT_BTB_LAST_TAKE       ,"btb_last_take"       ,Tcontrol_t         ,1);
+      ALLOC1_SIGNAL_IN ( in_PREDICT_BTB_IS_ACCURATE     ,"btb_is_accurate"     ,Tcontrol_t         ,1);
+      ALLOC1_SIGNAL_IN ( in_PREDICT_DIR_HISTORY         ,"dir_history"         ,Thistory_t         ,_param->_size_history);
+      ALLOC1_SIGNAL_IN ( in_PREDICT_RAS_ADDRESS         ,"ras_address"         ,Taddress_t         ,_param->_size_address);
+      ALLOC1_SIGNAL_IN ( in_PREDICT_RAS_INDEX           ,"ras_index"           ,Tptr_t             ,_param->_max_size_ras_index);
+//       ALLOC1_SIGNAL_OUT(out_PREDICT_UPDATE_PREDICTION_ID,"update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth);
+    }
+
+    // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      ALLOC1_INTERFACE("predict", IN,SOUTH, "predict", _param->_nb_inst_predict);
+
+      ALLOC1_VALACK_IN ( in_DECOD_VAL                 ,VAL);
+      ALLOC1_VALACK_OUT(out_DECOD_ACK                 ,ACK);
+      ALLOC1_SIGNAL_IN ( in_DECOD_CONTEXT_ID          ,"context_id"          ,Tcontext_t         ,_param->_size_context_id);
+      ALLOC1_SIGNAL_IN ( in_DECOD_BTB_ADDRESS_SRC     ,"btb_address_src"     ,Taddress_t         ,_param->_size_address);
+      ALLOC1_SIGNAL_IN ( in_DECOD_BTB_ADDRESS_DEST    ,"btb_address_dest"    ,Taddress_t         ,_param->_size_address);
+      ALLOC1_SIGNAL_IN ( in_DECOD_BTB_CONDITION       ,"btb_condition"       ,Tbranch_condition_t,_param->_size_branch_condition);
+      ALLOC1_SIGNAL_IN ( in_DECOD_BTB_LAST_TAKE       ,"btb_last_take"       ,Tcontrol_t         ,1);
+      ALLOC1_SIGNAL_IN ( in_DECOD_RAS_ADDRESS         ,"ras_address"         ,Taddress_t         ,_param->_size_address);
+      ALLOC1_SIGNAL_IN ( in_DECOD_RAS_INDEX           ,"ras_index"           ,Tptr_t             ,_param->_max_size_ras_index);
+      ALLOC1_SIGNAL_IN ( in_DECOD_MISS_PREDICTION     ,"miss_prediction"     ,Tcontrol_t         ,1);
+      ALLOC1_SIGNAL_IN ( in_DECOD_UPDATE_PREDICTION_ID,"update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth);
+//    ALLOC1_SIGNAL_OUT(out_DECOD_DEPTH               ,"depth"               ,Tdepth_t           ,_param->_size_depth);
+    }
+
+    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      ALLOC1_INTERFACE("branch_complete", IN,SOUTH, "branch_complete", _param->_nb_inst_branch_complete);
+
+      
+      ALLOC1_VALACK_IN ( in_BRANCH_COMPLETE_VAL            ,VAL);
+      ALLOC1_VALACK_OUT(out_BRANCH_COMPLETE_ACK            ,ACK);
+      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_CONTEXT_ID     ,"context_id"     ,Tcontext_t,_param->_size_context_id);
+      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_DEPTH          ,"depth"          ,Tdepth_t  ,_param->_size_depth);
+      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_ADDRESS        ,"address"        ,Taddress_t,_param->_size_address);
+      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_FLAG           ,"flag"           ,Tcontrol_t,1);
+      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_MISS_PREDICTION,"miss_prediction",Tcontrol_t,1);
+      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_TAKE           ,"take"           ,Tcontrol_t,1);
+      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_ADDRESS_SRC    ,"address_src"    ,Taddress_t,_param->_size_address);
+      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_ADDRESS_DEST   ,"address_dest"   ,Taddress_t,_param->_size_address);
+    }
+
+    // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      ALLOC1_INTERFACE("update",OUT,SOUTH, "update", _param->_nb_inst_update);
+
+      ALLOC1_VALACK_OUT(out_UPDATE_VAL                  ,VAL);
+      ALLOC1_VALACK_IN ( in_UPDATE_ACK                  ,ACK);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_CONTEXT_ID           ,"context_id"           ,Tcontext_t         ,_param->_size_context_id);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_MISS_PREDICTION      ,"miss_prediction"      ,Tcontrol_t         ,1);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_DIRECTION_GOOD       ,"direction_good"       ,Tcontrol_t         ,1);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_BTB_VAL              ,"btb_val"              ,Tcontrol_t         ,1);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_BTB_ADDRESS_SRC      ,"btb_address_src"      ,Taddress_t         ,_param->_size_address);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_BTB_ADDRESS_DEST     ,"btb_address_dest"     ,Taddress_t         ,_param->_size_address);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_BTB_CONDITION        ,"btb_condition"        ,Tbranch_condition_t,_param->_size_branch_condition);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_DIR_VAL              ,"dir_val"              ,Tcontrol_t         ,1);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_DIR_HISTORY          ,"dir_history"          ,Thistory_t         ,_param->_size_history);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_RAS_VAL              ,"ras_val"              ,Tcontrol_t         ,1);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_RAS_ADDRESS          ,"ras_address"          ,Taddress_t         ,_param->_size_address);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_RAS_INDEX            ,"ras_index"            ,Tptr_t             ,_param->_max_size_ras_index);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_RAS_PREDICTION_IFETCH,"ras_prediction_ifetch",Tcontrol_t         ,1);
+    }
+
+    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      ALLOC1_INTERFACE("depth",OUT,SOUTH, "depth", _param->_nb_context);
+
+      ALLOC1_SIGNAL_OUT(out_DEPTH_NB_BRANCH,"NB_BRANCH",Tdepth_t,_param->_size_depth);
+      ALLOC1_SIGNAL_OUT(out_DEPTH_TAIL,"TAIL",Tdepth_t,_param->_size_depth);
+    }
+
+    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    internal_PREDICT_ACK                     = new Tcontrol_t [_param->_nb_inst_predict];
+    internal_DECOD_ACK                       = new Tcontrol_t [_param->_nb_inst_decod];
+    internal_BRANCH_COMPLETE_ACK             = new Tcontrol_t [_param->_nb_inst_branch_complete];
+    internal_BRANCH_COMPLETE_MISS_PREDICTION = new Tcontrol_t [_param->_nb_inst_branch_complete];
+    internal_BRANCH_COMPLETE_TAKE            = new Tcontrol_t [_param->_nb_inst_branch_complete];
+    internal_BRANCH_COMPLETE_ADDRESS_DEST    = new Taddress_t [_param->_nb_inst_branch_complete];
+    internal_UPDATE_VAL                      = new Tcontrol_t [_param->_nb_inst_update];
+    internal_UPDATE_CONTEXT_ID               = new Tcontext_t [_param->_nb_inst_update];
+    internal_UPDATE_DEPTH                    = new Tdepth_t   [_param->_nb_inst_update];
+
+    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    reg_TOP                     = new uint32_t  [_param->_nb_context];
+    reg_BOTTOM                  = new uint32_t  [_param->_nb_context];
+    reg_NB_ELT                  = new uint32_t  [_param->_nb_context];
+    reg_NB_ELT_NEED_UPDATE      = new uint32_t  [_param->_nb_context];
+    reg_UPDATE_PREDICTION_TABLE = new entry_t * [_param->_nb_context];
+    for (uint32_t i=0; i<_param->_nb_context; i++)
+      {
+#ifndef NO_INIT
+	reg_TOP [i] = 0;
+#endif
+	reg_UPDATE_PREDICTION_TABLE [i] = new entry_t [_param->_size_queue[i]];
+      }
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp	(revision 81)
@@ -27,5 +27,100 @@
 	delete    in_CLOCK ;
 	delete    in_NRESET;
+
+	// ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	delete []  in_PREDICT_VAL                 ;
+	delete [] out_PREDICT_ACK                 ;
+	if (_param->_have_port_context_id)
+	delete []  in_PREDICT_CONTEXT_ID          ;
+	delete []  in_PREDICT_BTB_ADDRESS_SRC     ;
+	delete []  in_PREDICT_BTB_ADDRESS_DEST    ;
+	delete []  in_PREDICT_BTB_CONDITION       ;
+	delete []  in_PREDICT_BTB_LAST_TAKE       ;
+	delete []  in_PREDICT_BTB_IS_ACCURATE     ;
+	if (_param->_have_port_history)
+	delete []  in_PREDICT_DIR_HISTORY         ;
+	delete []  in_PREDICT_RAS_ADDRESS         ;
+	delete []  in_PREDICT_RAS_INDEX           ;
+// 	if (_param->_have_port_depth)
+// 	delete [] out_PREDICT_UPDATE_PREDICTION_ID;
+	
+	// ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	delete []  in_DECOD_VAL                   ;
+	delete [] out_DECOD_ACK                   ;
+	if (_param->_have_port_context_id)
+	delete []  in_DECOD_CONTEXT_ID            ;
+	delete []  in_DECOD_BTB_ADDRESS_SRC       ;
+	delete []  in_DECOD_BTB_ADDRESS_DEST      ;
+	delete []  in_DECOD_BTB_CONDITION         ;
+	delete []  in_DECOD_BTB_LAST_TAKE         ;
+	delete []  in_DECOD_RAS_ADDRESS           ;
+	delete []  in_DECOD_RAS_INDEX             ;
+	delete []  in_DECOD_MISS_PREDICTION       ;
+	if (_param->_have_port_depth)
+	delete []  in_DECOD_UPDATE_PREDICTION_ID  ;
+// 	if (_param->_have_port_depth)
+// 	delete [] out_DECOD_DEPTH                 ;
+	
+	// ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	delete []  in_BRANCH_COMPLETE_VAL            ;
+	delete [] out_BRANCH_COMPLETE_ACK            ;
+	if (_param->_have_port_context_id)
+	delete []  in_BRANCH_COMPLETE_CONTEXT_ID     ;
+	if (_param->_have_port_depth)
+	delete []  in_BRANCH_COMPLETE_DEPTH          ;
+	delete []  in_BRANCH_COMPLETE_ADDRESS        ;
+	delete []  in_BRANCH_COMPLETE_FLAG           ;
+	delete [] out_BRANCH_COMPLETE_MISS_PREDICTION;
+	delete [] out_BRANCH_COMPLETE_TAKE           ;
+	delete [] out_BRANCH_COMPLETE_ADDRESS_SRC    ;
+	delete [] out_BRANCH_COMPLETE_ADDRESS_DEST   ;
+	
+	// ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	delete [] out_UPDATE_VAL                  ;
+	delete []  in_UPDATE_ACK                  ;
+	if (_param->_have_port_context_id)
+	delete [] out_UPDATE_CONTEXT_ID           ;
+	delete [] out_UPDATE_MISS_PREDICTION      ;
+	delete [] out_UPDATE_DIRECTION_GOOD       ;
+	delete [] out_UPDATE_BTB_VAL              ;
+	delete [] out_UPDATE_BTB_ADDRESS_SRC      ;
+	delete [] out_UPDATE_BTB_ADDRESS_DEST     ;
+	delete [] out_UPDATE_BTB_CONDITION        ;
+	delete [] out_UPDATE_DIR_VAL              ;
+	if (_param->_have_port_history)
+	delete [] out_UPDATE_DIR_HISTORY          ;
+	delete [] out_UPDATE_RAS_VAL              ;
+	delete [] out_UPDATE_RAS_ADDRESS          ;
+	delete [] out_UPDATE_RAS_INDEX            ;
+	delete [] out_UPDATE_RAS_PREDICTION_IFETCH;
+
+	// ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	if (_param->_have_port_depth)
+	  {
+	delete [] out_DEPTH_NB_BRANCH;
+	delete [] out_DEPTH_TAIL;
+	  }
       }
+
+    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    delete [] internal_PREDICT_ACK                     ;
+    delete [] internal_DECOD_ACK                       ;
+    delete [] internal_BRANCH_COMPLETE_ACK             ;
+    delete [] internal_BRANCH_COMPLETE_MISS_PREDICTION ;
+    delete [] internal_BRANCH_COMPLETE_TAKE            ;
+    delete [] internal_BRANCH_COMPLETE_ADDRESS_DEST    ;
+    delete [] internal_UPDATE_VAL                      ;
+    delete [] internal_UPDATE_CONTEXT_ID               ;
+    delete [] internal_UPDATE_DEPTH                    ;
+
+    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    delete [] reg_TOP;
+    delete [] reg_BOTTOM;
+    delete [] reg_NB_ELT;
+    delete [] reg_NB_ELT_NEED_UPDATE;
+    for (uint32_t i=0; i<_param->_nb_context; i++)
+      delete [] reg_UPDATE_PREDICTION_TABLE [i];
+    delete [] reg_UPDATE_PREDICTION_TABLE;
+
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_branch_complete.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_branch_complete.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_branch_complete.cpp	(revision 81)
@@ -0,0 +1,105 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace update_prediction_table {
+
+
+#undef  FUNCTION
+#define FUNCTION "Update_Prediction_Table::genMealy_branch_complete"
+  void Update_Prediction_Table::genMealy_branch_complete (void)
+  {
+    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
+    
+    for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
+      {
+	Tcontext_t          context   = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0;
+	Tdepth_t            depth     = (_param->_have_port_depth     )?PORT_READ(in_BRANCH_COMPLETE_DEPTH      [i]):0;
+	Tcontrol_t          miss      = false;
+	Tcontrol_t          take      = reg_UPDATE_PREDICTION_TABLE [context][depth]._last_take   ;
+	Taddress_t          addr_dest = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest;
+	Tbranch_condition_t condition = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition   ;
+
+	switch (condition)
+	  {
+	  case BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK          : // l.j
+	  case BRANCH_CONDITION_NONE_WITH_WRITE_STACK             : // l.jal
+	    {
+	      //miss      : always hit
+	      //addr_dest : know in decod stage
+	      break;
+	    }
+	  case BRANCH_CONDITION_FLAG_UNSET                        : // l.bnf
+	    {
+	      Tcontrol_t take_good = PORT_READ(in_BRANCH_COMPLETE_FLAG [i]) == 0;
+	      miss = (take != take_good);
+	      take = take_good;
+	      //addr_dest : know in decod stage
+	      break;
+	    }
+	  case BRANCH_CONDITION_FLAG_SET                          : // l.bf
+	    {
+// 	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * BRANCH_CONDITION_FLAG_SET");
+	      
+	      Tcontrol_t take_good = PORT_READ(in_BRANCH_COMPLETE_FLAG [i]) == 1;
+	      miss = (take != take_good);
+	      take = take_good;
+
+// 	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * flag      : %d",PORT_READ(in_BRANCH_COMPLETE_FLAG [i]));
+// 	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * take_good : %d",take_good);
+// 	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * miss      : %d",miss);
+	      
+	      //addr_dest : know in decod stage
+	      break;
+	    }
+	  case BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK : // l.jr (rb!=r9)
+	  case BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK    : // l.jalr
+	  case BRANCH_CONDITION_READ_STACK                        : // l.jr (rb==r9)
+	    {
+	      Taddress_t addr_good = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]);
+	      miss = ((take == 1) and
+		      (addr_dest = addr_good));
+	      take = 1;
+	      addr_dest = addr_good;
+	      break;
+	    }
+	  }
+
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * miss      : %d",miss);
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * take      : %d",take);
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * address   : %x",addr_dest);
+
+	internal_BRANCH_COMPLETE_MISS_PREDICTION [i] = miss     ;
+	internal_BRANCH_COMPLETE_TAKE            [i] = take     ;
+	internal_BRANCH_COMPLETE_ADDRESS_DEST    [i] = addr_dest;
+
+	PORT_WRITE(out_BRANCH_COMPLETE_MISS_PREDICTION [i], internal_BRANCH_COMPLETE_MISS_PREDICTION [i]);
+	PORT_WRITE(out_BRANCH_COMPLETE_TAKE            [i], internal_BRANCH_COMPLETE_TAKE            [i]);
+	PORT_WRITE(out_BRANCH_COMPLETE_ADDRESS_SRC     [i], reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src);
+	PORT_WRITE(out_BRANCH_COMPLETE_ADDRESS_DEST    [i], internal_BRANCH_COMPLETE_ADDRESS_DEST    [i]);
+      }
+
+    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
+  };
+
+}; // end namespace update_prediction_table
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_decod.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_decod.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_decod.cpp	(revision 81)
@@ -0,0 +1,56 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace update_prediction_table {
+
+
+#undef  FUNCTION
+#define FUNCTION "Update_Prediction_Table::genMealy_decod"
+  void Update_Prediction_Table::genMealy_decod (void)
+  {
+    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
+    
+    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
+      {
+	Tcontrol_t miss = PORT_READ(in_DECOD_MISS_PREDICTION [i]);
+
+	if (miss)
+	  {
+	    // miss : need a empty slot.
+	    Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0;
+	    uint32_t   top     = reg_TOP[context];
+	    internal_DECOD_ACK [i] = (reg_UPDATE_PREDICTION_TABLE [context][top]._state == UPDATE_PREDICTION_STATE_EMPTY);
+	  }
+	else
+	  {
+	    internal_DECOD_ACK [i] = true;
+	  }
+
+	PORT_WRITE(out_DECOD_ACK [i], internal_DECOD_ACK [i]);
+      }
+
+    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
+  };
+
+}; // end namespace update_prediction_table
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_predict.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_predict.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_predict.cpp	(revision 81)
@@ -0,0 +1,61 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace update_prediction_table {
+
+
+#undef  FUNCTION
+#define FUNCTION "Update_Prediction_Table::genMealy_predict"
+  void Update_Prediction_Table::genMealy_predict (void)
+  {
+    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
+    
+    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+      {
+	Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_PREDICT_CONTEXT_ID [i]):0;
+	uint32_t   top     = reg_TOP[context];
+
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"PREDICT [%d] (genMealy)",i);
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * context     : %d",context);
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * top         : %d",top);
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * state       : %s",toString(reg_UPDATE_PREDICTION_TABLE [context][top]._state).c_str());
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * is accurate : %d",PORT_READ(in_PREDICT_BTB_IS_ACCURATE [i]));
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * need update : %d",reg_NB_ELT_NEED_UPDATE [context]);
+
+	// Not Full, accurate and no previous miss
+	// Optimisation to restart faster :
+	//   don't counter nb_elt_ko, but just nb_elt that need a update (change branch structure)
+	internal_PREDICT_ACK [i] = ((reg_UPDATE_PREDICTION_TABLE [context][top]._state == UPDATE_PREDICTION_STATE_EMPTY) and
+				    PORT_READ(in_PREDICT_BTB_IS_ACCURATE [i]) and
+				    (reg_NB_ELT_NEED_UPDATE [context] == 0));
+
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ACK         : %d",internal_PREDICT_ACK [i]);
+
+	PORT_WRITE(out_PREDICT_ACK [i], internal_PREDICT_ACK [i]);
+      }
+
+    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
+  };
+
+}; // end namespace update_prediction_table
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp	(revision 81)
@@ -0,0 +1,112 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_front_end {
+namespace front_end {
+namespace prediction_unit {
+namespace update_prediction_table {
+
+
+#undef  FUNCTION
+#define FUNCTION "Update_Prediction_Table::genMoore"
+  void Update_Prediction_Table::genMoore (void)
+  {
+    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
+
+    // ===================================================================
+    // =====[ DEPTH ]=====================================================
+    // ===================================================================
+
+    if (_param->_have_port_depth)
+      for (uint32_t i=0; i<_param->_nb_context; i++)
+	{
+	  PORT_WRITE(out_DEPTH_NB_BRANCH [i], reg_NB_ELT [i]);
+	  PORT_WRITE(out_DEPTH_TAIL      [i], reg_BOTTOM [i]);
+	}
+
+    // ===================================================================
+    // =====[ UPDATE ]====================================================
+    // ===================================================================
+
+    Tdepth_t tab_depth [_param->_nb_context];
+    for (uint32_t i=0; i<_param->_nb_context; i++)
+      tab_depth [i] = reg_BOTTOM [i];
+
+    for (uint32_t i=0; i<_param->_nb_inst_update; i++)
+      {
+	uint32_t   context = (reg_UPDATE_PRIORITY+i)%_param->_nb_context;
+	Tdepth_t   depth   = tab_depth[context];
+	state_t    state   = reg_UPDATE_PREDICTION_TABLE [context][depth]._state;
+	
+	Tcontrol_t val     = ((state == UPDATE_PREDICTION_STATE_OK) or
+			      (state == UPDATE_PREDICTION_STATE_KO));
+
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"UPDATE [%d] (genMoore)",i);
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * context     : %d",context);
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * depth       : %d",depth);
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * state       : %s",toString(state).c_str());
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * val         : %d",val);
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * addr_src    : %x",reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src );
+// 	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * addr_dest   : %x",reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest);
+
+	if (val)
+	  {
+	    Tbranch_condition_t cond    = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition;
+		      
+	    Tcontrol_t          ifetch  = reg_UPDATE_PREDICTION_TABLE [context][depth]._ifetch_prediction;
+	    Tcontrol_t          btb_val = true;
+	    Tcontrol_t          dir_val = (ifetch and // not ifetch == static prediction
+					   ((cond == BRANCH_CONDITION_FLAG_UNSET) or
+					    (cond == BRANCH_CONDITION_FLAG_SET)));
+	    Tcontrol_t          ras_val = ((cond == BRANCH_CONDITION_NONE_WITH_WRITE_STACK) or
+					   (cond == BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK) or
+					   (cond == BRANCH_CONDITION_READ_STACK));
+	      
+	    if (_param->_have_port_context_id)
+	    PORT_WRITE(out_UPDATE_CONTEXT_ID            [i],context);
+	    PORT_WRITE(out_UPDATE_MISS_PREDICTION       [i],(state == UPDATE_PREDICTION_STATE_KO));
+	    PORT_WRITE(out_UPDATE_DIRECTION_GOOD        [i],reg_UPDATE_PREDICTION_TABLE [context][depth]._good_take   );
+	    PORT_WRITE(out_UPDATE_BTB_VAL               [i],btb_val);
+	    PORT_WRITE(out_UPDATE_BTB_ADDRESS_SRC       [i],reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src );
+	    PORT_WRITE(out_UPDATE_BTB_ADDRESS_DEST      [i],reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest);
+	    PORT_WRITE(out_UPDATE_BTB_CONDITION         [i],cond);
+	    PORT_WRITE(out_UPDATE_DIR_VAL               [i],dir_val);
+	    if (_param->_have_port_history)
+	    PORT_WRITE(out_UPDATE_DIR_HISTORY           [i],reg_UPDATE_PREDICTION_TABLE [context][depth]._history     );
+	    PORT_WRITE(out_UPDATE_RAS_VAL               [i],ras_val);
+	    PORT_WRITE(out_UPDATE_RAS_ADDRESS           [i],reg_UPDATE_PREDICTION_TABLE [context][depth]._address_ras );
+	    PORT_WRITE(out_UPDATE_RAS_INDEX             [i],reg_UPDATE_PREDICTION_TABLE [context][depth]._index_ras   );
+	    PORT_WRITE(out_UPDATE_RAS_PREDICTION_IFETCH [i],ifetch);
+
+	    internal_UPDATE_CONTEXT_ID [i] = context;
+	    internal_UPDATE_DEPTH      [i] = depth;
+
+	    tab_depth[context] = (depth+1)%_param->_size_queue[context];
+	  }
+
+	internal_UPDATE_VAL [i] = val;
+	PORT_WRITE(out_UPDATE_VAL [i], internal_UPDATE_VAL [i]);
+      }
+
+    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
+  };
+
+}; // end namespace update_prediction_table
+}; // end namespace prediction_unit
+}; // end namespace front_end
+}; // end namespace multi_front_end
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp	(revision 81)
@@ -24,4 +24,249 @@
     log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
 
+    if (PORT_READ(in_NRESET) == 0)
+      {
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  {
+	    reg_TOP                [i] = 0;
+	    reg_BOTTOM             [i] = 0;
+	    reg_NB_ELT             [i] = 0;
+	    reg_NB_ELT_NEED_UPDATE [i] = 0;
+	    for (uint32_t j=0; j<_param->_size_queue[i]; j++)
+	      reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EMPTY;
+	  }
+	reg_UPDATE_PRIORITY = 0;
+      }
+    else
+      {
+	// ===================================================================
+	// =====[ PREDICT ]===================================================
+	// ===================================================================
+	for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
+	  if (PORT_READ(in_PREDICT_VAL[i]) and internal_PREDICT_ACK [i])
+	    {
+	      Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_PREDICT_CONTEXT_ID [i]):0;
+	      uint32_t   top     = reg_TOP [context];
+
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"PREDICT[%d] - Accepted",i);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION," * top     : %d",top);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION," * nb_elt  : %d",reg_NB_ELT[context]);
+
+	      reg_UPDATE_PREDICTION_TABLE [context][top]._state        = UPDATE_PREDICTION_STATE_WAIT_DECOD;
+	      reg_UPDATE_PREDICTION_TABLE [context][top]._ifetch_prediction = true;
+	      reg_UPDATE_PREDICTION_TABLE [context][top]._condition    = PORT_READ(in_PREDICT_BTB_CONDITION    [i]);
+	      reg_UPDATE_PREDICTION_TABLE [context][top]._address_src  = PORT_READ(in_PREDICT_BTB_ADDRESS_SRC  [i]);
+	      reg_UPDATE_PREDICTION_TABLE [context][top]._address_dest = PORT_READ(in_PREDICT_BTB_ADDRESS_DEST [i]);
+	      reg_UPDATE_PREDICTION_TABLE [context][top]._last_take    = PORT_READ(in_PREDICT_BTB_LAST_TAKE    [i]);
+	    //reg_UPDATE_PREDICTION_TABLE [context][top]._good_take    
+	      reg_UPDATE_PREDICTION_TABLE [context][top]._history      = (_param->_have_port_history)?PORT_READ(in_PREDICT_DIR_HISTORY [i]):0;
+	      reg_UPDATE_PREDICTION_TABLE [context][top]._address_ras  = PORT_READ(in_PREDICT_RAS_ADDRESS      [i]);
+	      reg_UPDATE_PREDICTION_TABLE [context][top]._index_ras    = PORT_READ(in_PREDICT_RAS_INDEX        [i]);
+
+	      reg_TOP    [context] = (top+1)%_param->_size_queue [context];
+	      reg_NB_ELT [context] ++;
+	    }
+
+	// ===================================================================
+	// =====[ DECOD ]=====================================================
+	// ===================================================================
+	for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
+	  if (PORT_READ(in_DECOD_VAL[i]) and internal_DECOD_ACK [i])
+	    {
+	      Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0;
+	      Tcontrol_t miss    = PORT_READ(in_DECOD_MISS_PREDICTION [i]);
+
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"DECOD[%d] - Accepted",i);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION," * miss    : %d",miss);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION," * nb_elt  : %d",reg_NB_ELT[context]);
+	      
+	      // Test if miss ifetch
+	      //   miss ifetch = decod a branch and the predict unit have not predict this branch ... gloup :P
+	      if (miss)
+		{
+		  Tdepth_t depth = (_param->_have_port_depth)?PORT_READ(in_DECOD_UPDATE_PREDICTION_ID [i]):0;
+		  Tdepth_t top   = reg_TOP [context];
+
+		  reg_UPDATE_PREDICTION_TABLE [context][top]._state        = UPDATE_PREDICTION_STATE_WAITEND;
+		  reg_UPDATE_PREDICTION_TABLE [context][top]._ifetch_prediction = false; // static prediction
+		  reg_UPDATE_PREDICTION_TABLE [context][top]._condition    = PORT_READ(in_DECOD_BTB_CONDITION    [i]);
+		  reg_UPDATE_PREDICTION_TABLE [context][top]._address_src  = PORT_READ(in_DECOD_BTB_ADDRESS_SRC  [i]);
+		  reg_UPDATE_PREDICTION_TABLE [context][top]._address_dest = PORT_READ(in_DECOD_BTB_ADDRESS_DEST [i]);
+		  reg_UPDATE_PREDICTION_TABLE [context][top]._last_take    = PORT_READ(in_DECOD_BTB_LAST_TAKE    [i]);
+		//reg_UPDATE_PREDICTION_TABLE [context][top]._good_take
+		//reg_UPDATE_PREDICTION_TABLE [context][top]._history
+		  reg_UPDATE_PREDICTION_TABLE [context][top]._address_ras  = PORT_READ(in_DECOD_RAS_ADDRESS      [i]);
+		  reg_UPDATE_PREDICTION_TABLE [context][top]._index_ras    = PORT_READ(in_DECOD_RAS_INDEX        [i]);
+
+		  // Invalid all previous "ifetch" prediction 
+		  // (ifetch prediction = prediction make in fetch stage and not again comming in decod stage)
+		  uint32_t nb_elt_miss        = ((top> depth)?top:(top+_param->_size_queue[context]))-depth;
+		  uint32_t nb_elt_need_update = 0;
+		  for (uint32_t j=0; j<nb_elt_miss; j++)
+		    {
+		      uint32_t k=(depth+j)%_param->_size_queue[context];
+		      
+		      // Ifetch have make a prediction and it's a miss
+		      // When ifetch predict :
+		      //   * btb is not change       -> needn't update
+		      //   * direction is not change -> needn't update
+		      //   * ras have change         -> need    update
+
+		      Tbranch_condition_t cond = reg_UPDATE_PREDICTION_TABLE [context][k]._condition;
+		      if ((cond == BRANCH_CONDITION_NONE_WITH_WRITE_STACK) or
+			  (cond == BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK) or
+			  (cond == BRANCH_CONDITION_READ_STACK))
+			{
+			  nb_elt_need_update ++;
+			  reg_UPDATE_PREDICTION_TABLE [context][k]._state = UPDATE_PREDICTION_STATE_KO;
+			}
+		      else
+			{
+			  reg_UPDATE_PREDICTION_TABLE [context][k]._state = UPDATE_PREDICTION_STATE_END;
+			}
+		    }
+
+		  reg_TOP                [context] = (depth+1)%_param->_size_queue [context];
+		  reg_NB_ELT_NEED_UPDATE [context] += nb_elt_need_update;
+		  reg_NB_ELT             [context] ++;
+		}
+	      else
+		{
+		  // Normal case : branch is previous predicated, change state of branch
+		  Tdepth_t depth = (_param->_have_port_depth)?PORT_READ(in_DECOD_UPDATE_PREDICTION_ID [i]):0;
+
+		  reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_WAITEND;
+		}
+	    }
+
+	// ===================================================================
+	// =====[ BRANCH_COMPLETE ]===========================================
+	// ===================================================================
+	for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
+	  if (PORT_READ(in_BRANCH_COMPLETE_VAL[i]) and internal_BRANCH_COMPLETE_ACK [i])
+	    {
+	      Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0;
+	      Tdepth_t   depth   = (_param->_have_port_depth     )?PORT_READ(in_BRANCH_COMPLETE_DEPTH      [i]):0;
+
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"BRANCH_COMPLETE[%d] - Accepted",i);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION," * depth   : %d",depth);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION," * nb_elt  : %d",reg_NB_ELT[context]);
+	      
+	      if (internal_BRANCH_COMPLETE_MISS_PREDICTION [i])
+		{
+		  // Miss case
+		  reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_KO;
+
+		  // Another prediction (prediction with depth higer)
+		  Tdepth_t top                = reg_TOP [context];
+		  uint32_t nb_elt_miss        = ((top> depth)?top:(top+_param->_size_queue[context]))-depth;
+		  uint32_t nb_elt_need_update = 1;
+		  for (uint32_t j=1; j<nb_elt_miss; j++)
+		    {
+		      uint32_t k=(depth+j)%_param->_size_queue[context];
+		      
+		      // Ifetch have make a prediction and it's a miss
+		      // When ifetch predict :
+		      //   * btb is not change       -> needn't update
+		      //   * direction is not change -> needn't update
+		      //   * ras have change         -> need    update
+
+		      Tbranch_condition_t cond = reg_UPDATE_PREDICTION_TABLE [context][k]._condition;
+		      if ((cond == BRANCH_CONDITION_NONE_WITH_WRITE_STACK) or
+			  (cond == BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK) or
+			  (cond == BRANCH_CONDITION_READ_STACK))
+			{
+			  nb_elt_need_update ++;
+			  reg_UPDATE_PREDICTION_TABLE [context][k]._state = UPDATE_PREDICTION_STATE_KO;
+			}
+		      else
+			{
+			  reg_UPDATE_PREDICTION_TABLE [context][k]._state = UPDATE_PREDICTION_STATE_END;
+			}
+		    }
+		  reg_NB_ELT_NEED_UPDATE [context] += nb_elt_need_update;
+
+		  // Update pointer :
+		  reg_TOP                [context]  = depth;
+		  reg_NB_ELT             [context] -= nb_elt_miss;
+		}
+	      else
+		{
+		  // Hit case
+#ifdef DEBUG_TEST
+		  if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state != UPDATE_PREDICTION_STATE_WAITEND)
+		    ERRORMORPHEO(FUNCTION,"Branche complete : invalid state");
+#endif
+		  reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_OK;
+		}
+
+	      // In all case : update good_take and address_destination
+	      reg_UPDATE_PREDICTION_TABLE [context][depth]._good_take    = internal_BRANCH_COMPLETE_TAKE         [i];
+	      reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest = internal_BRANCH_COMPLETE_ADDRESS_DEST [i];
+	    }
+
+	// ===================================================================
+	// =====[ UPDATE ]====================================================
+	// ===================================================================
+	for (uint32_t i=0; i<_param->_nb_inst_update; i++)
+	  if (internal_UPDATE_VAL[i] and PORT_READ(in_UPDATE_ACK [i]))
+	    {
+	      Tcontext_t context = internal_UPDATE_CONTEXT_ID [i];
+	      Tdepth_t   depth   = internal_UPDATE_DEPTH      [i];
+
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"UPDATE[%d] - Accepted",i);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION," * depth   : %d",depth);
+
+	      if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_KO)
+		reg_NB_ELT_NEED_UPDATE [context] --;
+
+	      reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END;
+	    }
+	
+	// Round robin
+	reg_UPDATE_PRIORITY = (reg_UPDATE_PRIORITY+1)%_param->_nb_context;
+
+	// ===================================================================
+	// =====[ GARBAGE COLLECTOR ]=========================================
+	// ===================================================================
+
+	for (uint32_t i=0; i<_param->_nb_context; i++)
+	  {
+	    uint32_t bottom = reg_BOTTOM [i];
+	    
+	    // Test if the tail of queue is finish (ok or ko and update)
+	    if (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END)
+	      {
+		log_printf(TRACE,Update_Prediction_Table,FUNCTION,"GARBAGE_COLLECTOR");
+		log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",i);
+		log_printf(TRACE,Update_Prediction_Table,FUNCTION," * bottom  : %d",bottom);
+
+		reg_UPDATE_PREDICTION_TABLE [i][bottom]._state = UPDATE_PREDICTION_STATE_EMPTY;
+		reg_BOTTOM [i] = (bottom+1)%_param->_size_queue [i];
+		if (reg_NB_ELT [i]>0)
+		  reg_NB_ELT [i] --;
+	      }
+	  }
+      }
+
+// #if (DEBUG >= DEBUG_TRACE)
+    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"Dump Update_Prediction_Table");
+    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * reg_UPDATE_PRIORITY      : %d",reg_UPDATE_PRIORITY);
+    for (uint32_t i=0; i<_param->_nb_context; i++)
+      {
+	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * Update_Prediction_Table [%d]",i);
+	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_TOP                : %d",reg_TOP                [i]);
+	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_BOTTOM             : %d",reg_BOTTOM             [i]);
+	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_NB_ELT             : %d",reg_NB_ELT             [i]);
+	log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_NB_ELT_NEED_UPDATE : %d",reg_NB_ELT_NEED_UPDATE [i]);
+	for (uint32_t j=0; j<_param->_size_queue[i]; j++)
+	  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      [%d] %s %x",j,toString(reg_UPDATE_PREDICTION_TABLE [i][j]._state).c_str(),reg_UPDATE_PREDICTION_TABLE [i][j]._address_src);
+      }
+// #endif
+
+
 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     end_cycle ();
