Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/Makefile	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/Makefile	(revision 88)
@@ -24,4 +24,6 @@
 library_clean			: Update_Prediction_Table_library_clean
 
+local_clean			:
+
 include                         $(DIR_COMPONENT)/Makefile.deps
 include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/config_min.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/config_min.cfg	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/config_min.cfg	(revision 88)
@@ -1,5 +1,6 @@
 Update_Prediction_Table
 1	1	+1	# nb_context             
-1	4	*4	# size_queue             [0] [nb_context]
+1	1	*4	# size_upt_queue         [0] [nb_context]
+1	1	*4	# size_ufpt_queue        [0] [nb_context]
 32	32	*2	# size_address           
 1	1	*4	# nb_inst_predict        
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 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/config_mono_context.cfg	(revision 88)
@@ -1,5 +1,6 @@
 Update_Prediction_Table
 1	1	+1	# nb_context             
-1	4	*4	# size_queue             [0] [nb_context]
+4	8	*2	# size_upt_queue         [0] [nb_context]
+1	4	*2	# size_ufpt_queue        [0] [nb_context]
 32	32	*2	# size_address           
 4	4	*4	# nb_inst_predict        
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 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/config_multi_context.cfg	(revision 88)
@@ -1,8 +1,12 @@
 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]
+4	4	*4	# size_upt_queue         [0] [nb_context]
+2	2	*4	# size_upt_queue         [1] [nb_context]
+8	8	*4	# size_upt_queue         [2] [nb_context]
+1 	1 	*4	# size_upt_queue         [3] [nb_context]
+4	4	*4	# size_ufpt_queue        [0] [nb_context]
+1	1	*4	# size_ufpt_queue        [1] [nb_context]
+2	2	*4	# size_ufpt_queue        [2] [nb_context]
+1 	1 	*4	# size_ufpt_queue        [3] [nb_context]
 32	32	*2	# size_address           
 4	4	*4	# nb_inst_predict        
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 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/main.cpp	(revision 88)
@@ -15,5 +15,6 @@
   err (_("list_params is :\n"));
   err (_(" * nb_context                           (uint32_t)\n"));
-  err (_(" * size_queue              [nb_context] (uint32_t)\n"));
+  err (_(" * size_upt_queue          [nb_context] (uint32_t)\n"));
+  err (_(" * size_ufpt_queue         [nb_context] (uint32_t)\n"));
   err (_(" * size_address                         (uint32_t)\n"));
   err (_(" * nb_inst_predict                      (uint32_t)\n"));
@@ -42,10 +43,13 @@
   uint32_t   _nb_context              = fromString<uint32_t>(argv[x++]);
 
-  if (argc != static_cast<int>(2+NB_PARAMS+2*_nb_context))
+  if (argc != static_cast<int>(2+NB_PARAMS+3*_nb_context))
     usage (argc, argv);
 
-  uint32_t * _size_queue              = new uint32_t [_nb_context];
+  uint32_t * _size_upt_queue              = new uint32_t [_nb_context];
   for (uint32_t i=0; i<_nb_context; i++)
-    _size_queue [i] = fromString<uint32_t>(argv[x++]);
+    _size_upt_queue  [i] = fromString<uint32_t>(argv[x++]);
+  uint32_t * _size_ufpt_queue             = new uint32_t [_nb_context];
+  for (uint32_t i=0; i<_nb_context; i++)
+    _size_ufpt_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++]);
@@ -63,5 +67,6 @@
       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
 	(_nb_context             ,
-	 _size_queue             ,
+	 _size_upt_queue         ,
+	 _size_ufpt_queue        ,
 	 _size_address           ,
 	 _nb_inst_predict        ,
@@ -70,5 +75,7 @@
 	 _nb_inst_update         ,
 	 _size_history           ,
-	 _size_ras_index         );
+	 _size_ras_index         ,
+         true //is_toplevel
+         );
       
       msg(_("%s"),param->print(1).c_str());
@@ -89,5 +96,6 @@
 
   delete [] _size_ras_index;
-  delete [] _size_queue;
+  delete [] _size_ufpt_queue;
+  delete [] _size_upt_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 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp	(revision 88)
@@ -1,4 +1,4 @@
 /*
- * $Id$
+ * $id: test.cpp 82 2008-05-01 16:48:45Z rosiere $
  *
  * [ Description ]
@@ -13,4 +13,26 @@
 #include "Common/include/Test.h"
 #include "Behavioural/include/Allocation.h"
+
+typedef struct
+{
+  uint32_t            ufpt_ptr    ;
+  uint32_t            upt_ptr     ;
+
+  Tcontext_t          context     ;
+  Taddress_t          address_src ;
+  Taddress_t          address_dest;
+  Taddress_t          address_good;
+  Tbranch_condition_t condition   ;
+  Tcontrol_t          take        ;
+  Tcontrol_t          take_good   ;
+  Tcontrol_t          flag        ;
+  Tcontrol_t          is_accurate ;
+  Thistory_t          history     ;
+  Taddress_t          ras_address ;
+  Tptr_t              ras_index   ;
+  Tcontrol_t          miss_ifetch ;
+  Tcontrol_t          miss_decod  ;
+  Tcontrol_t          miss_commit ;
+} request_t;
 
 void test (string name,
@@ -61,5 +83,5 @@
   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(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);
@@ -75,4 +97,5 @@
   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_DECOD_IS_ACCURATE              ," in_DECOD_IS_ACCURATE              ",Tcontrol_t         ,_param->_nb_inst_decod);
 
   ALLOC1_SC_SIGNAL( in_BRANCH_COMPLETE_VAL            ," in_BRANCH_COMPLETE_VAL            ",Tcontrol_t         ,_param->_nb_inst_branch_complete);
@@ -111,6 +134,7 @@
   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);
+  ALLOC1_SC_SIGNAL(out_DEPTH_CURRENT                  ,"out_DEPTH_CURRENT                  ",Tdepth_t           ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL(out_DEPTH_MIN                      ,"out_DEPTH_MIN                      ",Tdepth_t           ,_param->_nb_context);
+  ALLOC1_SC_SIGNAL(out_DEPTH_MAX                      ,"out_DEPTH_MAX                      ",Tdepth_t           ,_param->_nb_context);
   
   /********************************************************
@@ -136,6 +160,6 @@
   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);
+  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);
@@ -150,13 +174,14 @@
   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_MISS_IFETCH              ,_param->_nb_inst_decod);
   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_MISS_DECOD               ,_param->_nb_inst_decod);
-  if (_param->_have_port_max_depth)
+  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_DECOD_IS_ACCURATE              ,_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_max_depth)
+  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);
@@ -171,5 +196,5 @@
 //   if (_param->_have_port_context_id)
 //   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_EVENT_CONTEXT_ID     ,_param->_nb_context);
-//   if (_param->_have_port_max_depth)
+//   if (_param->_have_port_depth)
 //   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_EVENT_DEPTH          ,_param->_nb_context);
 //   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_EVENT_ADDRESS        ,_param->_nb_context);
@@ -196,12 +221,10 @@
   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);
-  for (uint32_t i=0; i<_param->_nb_context; i++)
+  if (_param->_have_port_depth)
     {
-      if (_param->_have_port_depth[i])
-	{
-	  INSTANCE_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_TAIL      [i]);
-	}
-      INSTANCE_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_NB_BRANCH [i]);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_CURRENT                  ,_param->_nb_context);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_MIN                      ,_param->_nb_context);
     }
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_MAX                      ,_param->_nb_context);
 
   msg(_("<%s> : Start Simulation ............\n"),name.c_str());
@@ -225,4 +248,9 @@
   const  int32_t percent_transaction_update          = 75;
 
+
+
+  std::list<request_t> ufpt;
+  std::list<request_t> upt;
+
   SC_START(0);
   LABEL("Initialisation");
@@ -233,145 +261,211 @@
   in_NRESET->write(1);  
 
-  for (uint32_t i=0; i<_param->_nb_context; i++)
+  Tdepth_t ufpt_bottom [_param->_nb_context];
+  Tdepth_t ufpt_top    [_param->_nb_context];
+
+  Tdepth_t upt_bottom  [_param->_nb_context];
+  Tdepth_t upt_top     [_param->_nb_context];
+
+  for (uint32_t i=0; i<_param->_nb_context; ++i)
     {
-      PORT_WRITE(in_BRANCH_EVENT_ACK [i],1);
+      ufpt_bottom [i] = 0;
+      ufpt_top    [i] = 0;
+      upt_bottom  [i] = 0;
+      upt_top     [i] = 0;
     }
 
-  LABEL("Loop of Test");
+  for (uint32_t i=0; i<_param->_nb_context; ++i)
+    {
+      TEST(Tdepth_t,out_DEPTH_CURRENT [i]->read(),upt_top    [i]);
+      TEST(Tdepth_t,out_DEPTH_MIN     [i]->read(),upt_bottom [i]);
+      TEST(Tdepth_t,out_DEPTH_MAX     [i]->read(),upt_top    [i]);
+    }
 
   for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
     {
       LABEL("Iteration %d",iteration);
-      
+
+      for (uint32_t i=0; i<_param->_nb_inst_predict; ++i)
+        in_PREDICT_VAL         [i]->write(0);
+      for (uint32_t i=0; i<_param->_nb_inst_decod; ++i)
+        in_DECOD_VAL           [i]->write(0);
+      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i)
+        in_BRANCH_COMPLETE_VAL [i]->write(0);
+      for (uint32_t i=0; i<_param->_nb_context; ++i)
+        in_BRANCH_EVENT_ACK    [i]->write(0);
+      for (uint32_t i=0; i<_param->_nb_inst_update; ++i)
+        in_UPDATE_ACK          [i]->write(0);
+
+      //---------------------------------------------------------------------
+      //---------------------------------------------------------------------
+      // COMMON CASE
+      //---------------------------------------------------------------------
+      //---------------------------------------------------------------------
+      if (1)
       {
 	uint32_t context = rand() % _param->_nb_context;
-	
-// 	LABEL("KANE : %d",context);
-
-	LABEL("PREDICT - fill the queue");
-	
+
 	{
+          LABEL("PREDICT - fill the queue");
 	  uint32_t port = rand() % _param->_nb_inst_predict;
+
+          LABEL("  * context : %d",context);
+          LABEL("  * port    : %d",port);
 	  
-	  for (uint32_t i=0; i<_param->_size_queue[context]; i++)
+	  for (uint32_t i=0; i<_param->_size_ufpt_queue[context]; i++)
 	    {
-	      
-	      bool find = false;
+              request_t request;
+              request.context          = context;
+              request.address_src      = 0xdeadbeef+i;
+              request.address_dest     = 0x21071981+i;                                   
+              request.address_good     = request.address_dest;
+              request.condition        = BRANCH_CONDITION_FLAG_SET;                      
+              request.take             = 1;                                              
+              request.take_good        = 1;                                              
+              request.flag             = (request.condition == BRANCH_CONDITION_FLAG_SET)?request.take_good:(not request.take_good);
+              request.is_accurate      = true;
+              request.miss_ifetch      = false;
+              request.miss_decod       = false;
+              request.miss_commit      = false;
+              request.history          = i;                                              
+              request.ras_address      = 0xdeaddead+i;                                   
+              request.ras_index        = (0x12345678+i)%_param->_size_ras_index[context];
+              request.ufpt_ptr         = ufpt_top [context];
+//            request.upt_ptr;
+
+	      bool have_transaction = 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[context])
-		    {
-		      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
-		    }
-		      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), i);
+		  in_PREDICT_CONTEXT_ID       [port]->write(request.context     );
+		  in_PREDICT_BTB_ADDRESS_SRC  [port]->write(request.address_src );
+		  in_PREDICT_BTB_ADDRESS_DEST [port]->write(request.address_dest);
+		  in_PREDICT_BTB_CONDITION    [port]->write(request.condition   );
+		  in_PREDICT_BTB_LAST_TAKE    [port]->write(request.take        );
+		  in_PREDICT_BTB_IS_ACCURATE  [port]->write(request.is_accurate );
+		  in_PREDICT_DIR_HISTORY      [port]->write(request.history     );
+		  in_PREDICT_RAS_ADDRESS      [port]->write(request.ras_address );
+		  in_PREDICT_RAS_INDEX        [port]->write(request.ras_index   );
+		  
+		  if (_param->_have_port_depth)
+		  TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
+                  TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
 		      
-		  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());
+		  SC_START(0); // fct melay
+		  
+		  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;
+		      have_transaction = true;
+
+                      if (_param->_have_port_depth)
+                      TEST(Tprediction_ptr_t,out_PREDICT_UPDATE_PREDICTION_ID [port]->read(),ufpt_top [context]);
+                      
+                      ufpt_top [context] = (ufpt_top [context]+1)%_param->_size_ufpt_queue[context];
 		    }
 		  
-		  SC_START(1);
-		  
-		} while (not find);
-	      in_PREDICT_VAL              [port]->write(0);
-	      
-	      if (_param->_have_port_depth[context])
-		{
-		  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
-		}
-		  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), i+1);
-
+		  SC_START(1); // transition
+		  
+		} while (not have_transaction);
+
+              ufpt.push_back(request);
+
+	      in_PREDICT_VAL [port]->write(0);
+	    
+              if (_param->_have_port_depth)
+	      TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
+              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
 	    }
 	}
 	
-	LABEL("DECOD - hit ifetch");
-	
-	{
+        {
+          LABEL("DECOD");
 	  uint32_t port = rand() % _param->_nb_inst_decod;
-	  
-	  for (uint32_t i=0; i<_param->_size_queue[context]; i++)
+
+          LABEL("  * context : %d",context);
+          LABEL("  * port    : %d",port);
+          
+	  for (uint32_t i=0; i<_param->_size_ufpt_queue[context]; i++)
 	    {
-	      
-	      bool find = false;
+              request_t request = ufpt.front();
+
+	      bool have_transaction = 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_IFETCH          [port]->write(false);
-		  in_DECOD_MISS_DECOD           [port]->write(false);
-		  in_DECOD_UPDATE_PREDICTION_ID [port]->write(i);
-		  
-		  if (_param->_have_port_depth[context])
-		    {
-		      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());
+		  in_DECOD_CONTEXT_ID           [port]->write(request.context     );
+		  in_DECOD_BTB_ADDRESS_SRC      [port]->write(request.address_src );
+		  in_DECOD_BTB_ADDRESS_DEST     [port]->write(request.address_dest);
+		  in_DECOD_BTB_CONDITION        [port]->write(request.condition   );
+		  in_DECOD_BTB_LAST_TAKE        [port]->write(request.take        );
+		  in_DECOD_RAS_ADDRESS          [port]->write(request.ras_address );
+		  in_DECOD_RAS_INDEX            [port]->write(request.ras_index   );
+		  in_DECOD_UPDATE_PREDICTION_ID [port]->write(request.ufpt_ptr    );
+		  in_DECOD_MISS_IFETCH          [port]->write(request.miss_ifetch );
+		  in_DECOD_MISS_DECOD           [port]->write(request.miss_decod  );
+		  in_DECOD_IS_ACCURATE          [port]->write(request.is_accurate );
+
+		  SC_START(0); // fct melay
+		  
+		  LABEL("DECOD           [%d] %d - %d",
+                        port,
+                         in_PREDICT_VAL [port]->read(),
+                        out_PREDICT_ACK [port]->read());
 		  
 		  if (in_DECOD_VAL [port]->read() and out_DECOD_ACK [port]->read())
 		    {
-		      LABEL("DECOD           [%d] - Transaction accepted",port);
-		      find = true;
+		      LABEL("DECOD          [%d] - Transaction accepted",port);
+		      have_transaction = true;
+
+                      request.upt_ptr = upt_top [context];
+                      upt.push_back(request);
+                      ufpt.pop_front();
+
+                      upt_top [context] = (upt_top [context]+1)%_param->_size_upt_queue[context];
 		    }
-		  
-		  SC_START(1);
-		  
-		} while (not find);
+
+		  SC_START(1); // transition
+
+                } while (not have_transaction);
+
 	      in_DECOD_VAL              [port]->write(0);
 	      
-	      if (_param->_have_port_depth[context])
-		{
-		  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
-		}
-		  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
-	    }
-	}
+              if (_param->_have_port_depth)
+	      TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
+              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
+            }
+        }
+
+	{
+          LABEL("BRANCH_COMPLETE - hit ifetch");
 	
-	LABEL("BRANCH_COMPLETE - hit ifetch");
+	  uint32_t port = rand() % _param->_nb_inst_branch_complete;
 	
-	{
-	  uint32_t port = rand() % _param->_nb_inst_branch_complete;
-	  
-	  for (uint32_t i=0; i<_param->_size_queue[context]; i++)
+          LABEL("  * port    : %d",port);
+  
+          std::list<request_t>::iterator it_upt = upt.begin();
+
+// 	  for (uint32_t i=0; i<_param->_size_ufpt_queue[context]; i++)
+	  for (uint32_t i=0; i<upt.size(); i++)
 	    {
-	      bool find = false;
+	      bool have_transaction = 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[context])
-		    {
-		      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
-		    }
-		      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
+		  in_BRANCH_COMPLETE_VAL        [port]->write((rand()%100)<percent_transaction_branch_complete);
+		  in_BRANCH_COMPLETE_CONTEXT_ID [port]->write(it_upt->context     );
+		  in_BRANCH_COMPLETE_DEPTH      [port]->write(it_upt->upt_ptr     );
+		  in_BRANCH_COMPLETE_ADDRESS    [port]->write(it_upt->address_good);
+		  in_BRANCH_COMPLETE_FLAG       [port]->write(it_upt->flag        );
+
+                  if (_param->_have_port_depth)
+                  TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
+                  TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
 		  
 		  SC_START(0);
@@ -382,296 +476,115 @@
 		    {
 		      LABEL("BRANCH_COMPLETE [%d] - Transaction accepted",port);
-		      find = true;
+		      have_transaction = 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);
+		      TEST(Tcontrol_t,out_BRANCH_COMPLETE_MISS_PREDICTION[port]->read(),it_upt->miss_commit );
+		      TEST(Tcontrol_t,out_BRANCH_COMPLETE_TAKE           [port]->read(),it_upt->take_good   );
+		      TEST(Taddress_t,out_BRANCH_COMPLETE_ADDRESS_SRC    [port]->read(),it_upt->address_src );
+		      TEST(Taddress_t,out_BRANCH_COMPLETE_ADDRESS_DEST   [port]->read(),it_upt->address_good);
+
+                      it_upt ++;
 		    }
 		  
 		  SC_START(1);
-
-		} while (not find);
-	      in_BRANCH_COMPLETE_VAL              [port]->write(0);
+		} while (not have_transaction);
+
+	      in_BRANCH_COMPLETE_VAL [port]->write(0);
 	      
-	      if (_param->_have_port_depth[context])
-		{
-		  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
-		}
-		  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
+              if (_param->_have_port_depth)
+              TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
+              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
 	    }
 	}
+
+	{
+          LABEL("UPDATE - hit ifetch");
 	
-	LABEL("UPDATE - hit ifetch");
+	  uint32_t port = 0;
 	
-	{
-	  uint32_t port = 0; //rand() % _param->_nb_inst_update;
-	  
-	  for (uint32_t i=0; i<_param->_size_queue[context]; i++)
+          LABEL("  * port    : %d",port);
+          std::list<request_t>::iterator it_upt = upt.begin();
+  
+// 	  for (uint32_t i=0; i<_param->_size_ufpt_queue[context]; i++)
+	  for (uint32_t i=0; i<upt.size(); i++)
 	    {
-	      bool find = false;
+              LABEL("Address_src (-1): %.8x (%d)",out_UPDATE_BTB_ADDRESS_SRC [i]->read(),upt.size());
+
+	      bool have_transaction = false;
+
 	      do
 		{
+                  LABEL("Address_src (0) : %.8x",out_UPDATE_BTB_ADDRESS_SRC [i]->read());
+
 		  in_UPDATE_ACK [port]->write((rand()%100)<percent_transaction_update);
-		  
+
+//                   if (_param->_have_port_depth)
+//                   TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
+//                   TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
+		  
+                  LABEL("Address_src (1) : %.8x",out_UPDATE_BTB_ADDRESS_SRC [i]->read());
 		  SC_START(0);
+                  LABEL("Address_src (2) : %.8x",out_UPDATE_BTB_ADDRESS_SRC [i]->read());
+		  
+		  LABEL("UPDATE [%d] %d - %d.",port,out_UPDATE_VAL [port]->read(),in_UPDATE_ACK [port]->read());
 		  
 		  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(Tcontrol_t         ,out_UPDATE_RAS_PUSH              [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);
+		      have_transaction = true;
+		  
+                      if (_param->_have_port_context_id)
+                      TEST(Tcontext_t         ,out_UPDATE_CONTEXT_ID            [i]->read(),it_upt->context);
+                      TEST(Tcontrol_t         ,out_UPDATE_MISS_PREDICTION       [i]->read(),it_upt->miss_commit);
+                      TEST(Tcontrol_t         ,out_UPDATE_DIRECTION_GOOD        [i]->read(),it_upt->flag);
+                      TEST(Tcontrol_t         ,out_UPDATE_BTB_VAL               [i]->read(),update_btb(it_upt->condition));
+                      if (update_btb(it_upt->condition))
+                        {
+                      TEST(Taddress_t         ,out_UPDATE_BTB_ADDRESS_SRC       [i]->read(),it_upt->address_src);
+                      TEST(Taddress_t         ,out_UPDATE_BTB_ADDRESS_DEST      [i]->read(),it_upt->address_dest);
+                      TEST(Tbranch_condition_t,out_UPDATE_BTB_CONDITION         [i]->read(),it_upt->condition);
+                        }
+                      TEST(Tcontrol_t         ,out_UPDATE_DIR_VAL               [i]->read(),update_dir(it_upt->condition));
+                      if (update_dir(it_upt->condition))
+                      if (_param->_have_port_history)
+                      TEST(Thistory_t         ,out_UPDATE_DIR_HISTORY           [i]->read(),it_upt->history);
+                      TEST(Tcontrol_t         ,out_UPDATE_RAS_VAL               [i]->read(),update_ras(it_upt->condition));
+                      if (update_ras(it_upt->condition))
+                        {
+                      TEST(Tcontrol_t         ,out_UPDATE_RAS_PUSH              [i]->read(),push_ras  (it_upt->condition));
+                      TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [i]->read(),it_upt->ras_address);
+                      TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [i]->read(),it_upt->ras_index);
+                      TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [i]->read(),not it_upt->miss_ifetch);
+                        }
+                      ++ it_upt;
 		    }
-		  
+
 		  SC_START(1);
-		  
-		} while (not find);
-	      in_UPDATE_ACK              [port]->write(0);
+                  LABEL("Address_src (3) : %.8x",out_UPDATE_BTB_ADDRESS_SRC [i]->read());
+                  
+		} while (not have_transaction);
+
+              LABEL("Address_src (4) : %.8x",out_UPDATE_BTB_ADDRESS_SRC [i]->read());
+	      in_UPDATE_ACK [port]->write(0);
+              LABEL("Address_src (5) : %.8x",out_UPDATE_BTB_ADDRESS_SRC [i]->read());
+//               if (_param->_have_port_depth)
+//               TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
+//               TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
 	    }
-	  
-	  LABEL("Wait a moment");
-	  SC_START(2*_param->_size_queue[context]);
-  
-	  // wait the garbage collector
-	  while ((not (_param->_have_port_depth[context]) or (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);
-	    }
+          upt.clear();
 	}
+
+        // Wait Garbage Collector
+        {
+          upt_bottom [context] = (upt_bottom [context]+_param->_size_ufpt_queue[context])%_param->_size_upt_queue[context];
+//        upt_top    [context] = (upt_top    [context]);
+
+          while ((upt_bottom [context] != out_DEPTH_MIN [context]->read()) or
+                 (upt_top    [context] != out_DEPTH_MAX [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[context])
-		    {
-		      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[context])
-		{
-		  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_IFETCH          [port]->write(false);
-		  in_DECOD_MISS_DECOD           [port]->write(false);
-		  in_DECOD_UPDATE_PREDICTION_ID [port]->write(i);
-		  
-		  if (_param->_have_port_depth[context])
-		    {
-		      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[context])
-		{
-		  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[context])
-		    {
-		      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(Tcontrol_t         ,out_UPDATE_RAS_PUSH              [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
-	    while (((not (_param->_have_port_depth[context])) or (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");
-
-    }
+    }// ITERATION
 
   /********************************************************
@@ -699,5 +612,5 @@
   delete []  in_PREDICT_RAS_ADDRESS         ;
   delete []  in_PREDICT_RAS_INDEX           ;
-//delete [] out_PREDICT_UPDATE_PREDICTION_ID;
+  delete [] out_PREDICT_UPDATE_PREDICTION_ID;
   
   // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -715,4 +628,5 @@
   delete []  in_DECOD_UPDATE_PREDICTION_ID  ;
 //delete [] out_DECOD_DEPTH                 ;
+  delete []  in_DECOD_IS_ACCURATE           ;
   
   // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -756,6 +670,7 @@
 
   // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  delete [] out_DEPTH_NB_BRANCH;
-  delete [] out_DEPTH_TAIL;
+  delete [] out_DEPTH_CURRENT;
+  delete [] out_DEPTH_MIN;
+  delete [] out_DEPTH_MAX;
 
 #endif
