Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Parameters.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Parameters.cpp	(revision 88)
@@ -41,5 +41,6 @@
 			  uint32_t     dir_pht_size_address_share [3],
 			  uint32_t *   ras_size_queue                ,//[nb_context]
-			  uint32_t *   upt_size_queue                 //[nb_context]
+			  uint32_t *   upt_size_queue                ,//[nb_context]
+                          bool         is_toplevel
 			  )
   {
@@ -72,20 +73,13 @@
     _ras_size_queue             = ras_size_queue            ;
     _upt_size_queue             = upt_size_queue            ;
-
-    _size_context_id            = log2(_nb_context);
-//   public : uint32_t *   _size_inst_ifetch_ptr          ;//[nb_context]
-
-    _size_depth                 = new uint32_t [_nb_context];
+    
+    _array_size_depth           = new uint32_t [_nb_context];
     _size_ras_index             = new uint32_t [_nb_context];
+
     for (uint32_t i=0; i<_nb_context; i++)
       {
-	_size_depth     [i] = log2(_upt_size_queue [i]);
-	_size_ras_index [i] = log2(_ras_size_queue [i]);
+	_array_size_depth [i] = log2(_upt_size_queue [i]);
+	_size_ras_index   [i] = log2(_ras_size_queue [i]);
       }
-
-    _max_size_depth             = max<uint32_t>(_size_depth,_nb_context);
-    _have_port_context_id       = (_size_context_id > 0);
-    _have_port_max_depth        = (_max_size_depth  > 0);
-//   public : bool     *   _have_port_inst_ifetch_ptr     ;//[nb_context]
 
     _param_glue = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue   ::Parameters 
@@ -94,5 +88,5 @@
        _size_address          ,
        _nb_instruction        ,
-       _size_depth            ,
+       _array_size_depth      ,
        _nb_inst_decod         ,
        _nb_inst_branch_predict,
@@ -100,9 +94,4 @@
        _nb_inst_branch_update );
 
-    _size_inst_ifetch_ptr      = _param_glue->_size_inst_ifetch_ptr     ;
-    _have_port_depth           = _param_glue->_have_port_depth;
-    _have_port_inst_ifetch_ptr = _param_glue->_have_port_inst_ifetch_ptr;
-    _have_port_history         = (_size_history > 0);
-    
     _param_btb  = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::branch_target_buffer   ::Parameters 
       (_nb_context            ,
@@ -116,5 +105,5 @@
        _nb_inst_branch_update ,
        _btb_victim_scheme     );
-
+    
     _param_dir  = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction              ::Parameters 
       (_dir_predictor_scheme      ,
@@ -130,5 +119,6 @@
        _dir_pht_size_address_share);
 
-    _size_history = _param_dir->_size_history;
+    _size_history      = _param_dir->_size_history;
+    _have_port_history = (_size_history > 0);
 
     _param_ras  = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::return_address_stack   ::Parameters 
@@ -150,4 +140,23 @@
        _size_history           ,
        _size_ras_index         );
+
+
+    if (is_toplevel)
+      {
+        _size_context_id           = log2(_nb_context);
+        _size_depth                = max<uint32_t>(_array_size_depth,_nb_context);
+        _size_inst_ifetch_ptr      = log2(max<uint32_t>(_nb_instruction,_nb_context));
+        _size_instruction_address  = size_address;
+//      _size_nb_inst_decod        = ;
+//      _size_nb_inst_commit       = ;
+//      _size_ifetch_queue_ptr     = ;
+   
+        _have_port_context_id      = (_size_context_id > 0);
+        _have_port_depth           = (_size_depth  > 0);
+        _have_port_inst_ifetch_ptr = _size_inst_ifetch_ptr > 0;
+//      _have_port_ifetch_queue_ptr= _size_ifetch_queue_ptr > 0;
+
+        copy ();
+      }
 
     test();
@@ -176,6 +185,21 @@
     delete _param_glue;
 
-    delete [] _size_depth    ;
+    delete [] _array_size_depth;
     delete [] _size_ras_index;
+
+    log_printf(FUNC,Prediction_unit,FUNCTION,"End");
+  };
+
+#undef  FUNCTION
+#define FUNCTION "Prediction_unit::copy"
+  void Parameters::copy (void) 
+  {
+    log_printf(FUNC,Prediction_unit,FUNCTION,"Begin");
+  
+    COPY(_param_btb );
+    COPY(_param_dir );
+    COPY(_param_ras );
+    COPY(_param_upt );
+    COPY(_param_glue);
 
     log_printf(FUNC,Prediction_unit,FUNCTION,"End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit.cpp	(revision 88)
@@ -37,4 +37,10 @@
     log_printf(FUNC,Prediction_unit,FUNCTION,"Begin");
 
+#if DEBUG_Prediction_unit == true
+    log_printf(INFO,Prediction_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
+
+    std::cout << *param << std::endl;
+#endif    
+
     log_printf(INFO,Prediction_unit,FUNCTION,"Allocation");
 
@@ -46,5 +52,5 @@
 
 #ifdef STATISTICS
-    if (_usage & USE_STATISTICS)
+    if (usage_is_set(_usage,USE_STATISTICS))
       {	
 	log_printf(INFO,Prediction_unit,FUNCTION,"Allocation of statistics");
@@ -55,5 +61,5 @@
 
 #ifdef VHDL
-    if (_usage & USE_VHDL)
+    if (usage_is_set(_usage,USE_VHDL))
       {
 	// generate the vhdl
@@ -65,5 +71,5 @@
 
 #ifdef SYSTEMC
-    if (_usage & USE_SYSTEMC)
+    if (usage_is_set(_usage,USE_SYSTEMC))
       {
 	log_printf(INFO,Prediction_unit,FUNCTION,"Method - transition");
@@ -89,5 +95,5 @@
 
 #ifdef STATISTICS
-    if (_usage & USE_STATISTICS)
+    if (usage_is_set(_usage,USE_STATISTICS))
       {
 	statistics_deallocation();
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_allocation.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_allocation.cpp	(revision 88)
@@ -65,11 +65,11 @@
 	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_INST_IFETCH_PTR            ,"inst_ifetch_ptr"            ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr);
 	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]);
+	ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth);
       }
       {
-	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]);
+	ALLOC2_INTERFACE("predict",IN,SOUTH,"Interface with ifetch unit",_param->_nb_context,_param->_nb_instruction[it1]);
+	_ALLOC2_SIGNAL_OUT(out_PREDICT_INSTRUCTION_ENABLE         ,"instruction_enable"         ,Tcontrol_t         ,1,_param->_nb_context,_param->_nb_instruction[it1]);
       }
     }
@@ -78,16 +78,16 @@
     {
       {
-	ALLOC2_INTERFACE("decod",IN,SOUTH,"Interface with decod unit",_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_interface_it1]);
+	ALLOC2_INTERFACE("decod",IN,SOUTH,"Interface with decod unit",_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
 	
-	_ALLOC2_VALACK_IN ( in_DECOD_VAL                        ,VAL,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
-	_ALLOC2_VALACK_OUT(out_DECOD_ACK                        ,ACK,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
-	_ALLOC2_SIGNAL_IN ( in_DECOD_CONTEXT_ID                 ,"context_id"                 ,Tcontext_t         ,_param->_size_context_id      ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
-	_ALLOC2_SIGNAL_IN ( in_DECOD_MATCH_INST_IFETCH_PTR      ,"match_inst_ifetch_ptr"      ,Tcontrol_t         ,1                             ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
-	_ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state    ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
-	_ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_max_size_depth       ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
-	_ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_CONDITION           ,"branch_condition"           ,Tbranch_condition_t,_param->_size_branch_condition,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
-	_ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_DIRECTION           ,"branch_direction"           ,Tcontrol_t         ,1                             ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
-	_ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_SRC                ,"address_src"                ,Taddress_t         ,_param->_size_address         ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
-	_ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_DEST               ,"address_dest"               ,Taddress_t         ,_param->_size_address         ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
+	_ALLOC2_VALACK_IN ( in_DECOD_VAL                        ,VAL,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
+	_ALLOC2_VALACK_OUT(out_DECOD_ACK                        ,ACK,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
+	_ALLOC2_SIGNAL_IN ( in_DECOD_CONTEXT_ID                 ,"context_id"                 ,Tcontext_t         ,_param->_size_context_id      ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
+	_ALLOC2_SIGNAL_IN ( in_DECOD_MATCH_INST_IFETCH_PTR      ,"match_inst_ifetch_ptr"      ,Tcontrol_t         ,1                             ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
+	_ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state    ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
+	_ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth           ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
+	_ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_CONDITION           ,"branch_condition"           ,Tbranch_condition_t,_param->_size_branch_condition,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
+	_ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_DIRECTION           ,"branch_direction"           ,Tcontrol_t         ,1                             ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
+	_ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_SRC                ,"address_src"                ,Taddress_t         ,_param->_size_address         ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
+	_ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_DEST               ,"address_dest"               ,Taddress_t         ,_param->_size_address         ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
       }
     }
@@ -100,5 +100,5 @@
       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->_max_size_depth);
+      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);
@@ -116,5 +116,5 @@
       ALLOC1_VALACK_IN ( in_BRANCH_EVENT_ACK            ,ACK);
 //    ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_CONTEXT_ID     ,"context_id"     ,Tcontext_t,_param->_size_context_id);
-//    ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_DEPTH          ,"depth"          ,Tdepth_t  ,_param->_max_size_depth);
+//    ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_DEPTH          ,"depth"          ,Tdepth_t  ,_param->_size_depth);
 //    ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_MISS_PREDICTION,"miss_prediction",Tcontrol_t,1);
       ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_ADDRESS_SRC    ,"address_src"    ,Taddress_t,_param->_size_address);
@@ -126,6 +126,7 @@
       ALLOC1_INTERFACE("depth",OUT,SOUTH,"Interface with depth",_param->_nb_context);
 
-      ALLOC1_SIGNAL_OUT(out_DEPTH_NB_BRANCH    ,"nb_branch"    ,Tdepth_t,_param->_size_depth[alloc_signal_it1]+1);
-      ALLOC1_SIGNAL_OUT(out_DEPTH_TAIL         ,"tail"         ,Tdepth_t,_param->_size_depth[alloc_signal_it1]);
+      ALLOC1_SIGNAL_OUT(out_DEPTH_CURRENT      ,"current"      ,Tdepth_t,_param->_size_depth);
+      ALLOC1_SIGNAL_OUT(out_DEPTH_MIN          ,"min"          ,Tdepth_t,_param->_size_depth);
+      ALLOC1_SIGNAL_OUT(out_DEPTH_MAX          ,"max"          ,Tdepth_t,_param->_size_depth+1);
     }
 
@@ -551,4 +552,7 @@
 	  COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_CONTEXT_ID"      ,
 		                   dest,"out_PREDICT_UPT_"+toString(i)+"_CONTEXT_ID"      );
+	  if (_param->_have_port_depth)
+	  COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+       "_UPDATE_PREDICTION_ID",
+		                   dest, "in_PREDICT_UPT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID");
 	  COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_BTB_ADDRESS_SRC" ,
 		                   dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_ADDRESS_SRC" );
@@ -593,7 +597,9 @@
 	  COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_MISS_DECOD"          ,
 			           dest,"out_DECOD_UPT_"+toString(i)+"_MISS_DECOD"          ); 
-	  if (_param->_have_port_max_depth)
+	  if (_param->_have_port_depth)
 	  COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_UPDATE_PREDICTION_ID",
 			           dest,"out_DECOD_UPT_"+toString(i)+"_UPDATE_PREDICTION_ID");
+	  COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_IS_ACCURATE"         ,
+			           dest,"out_DECOD_UPT_"+toString(i)+"_IS_ACCURATE"         );
 	  
 	  //out_DECOD_UPT_RAS_INDEX - component_map return_address_stack
@@ -650,5 +656,5 @@
 	  PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID"     ,
 		              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID"     );
-	  if (_param->_have_port_max_depth)
+	  if (_param->_have_port_depth)
 	  PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"          ,
 		              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"          );
@@ -684,6 +690,5 @@
       for (uint32_t i=0; i<_param->_nb_context; i++)
 	{
-	  dest = _name+"_prediction_unit_glue";
-	  
+	  dest = _name;
 #ifdef POSITION
 	  _component->interface_map (src ,"depth_"+toString(i),
@@ -691,12 +696,31 @@
 #endif
 	  
-	  COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+    "_NB_BRANCH",
-			           dest, "in_DEPTH_"+toString(i)+"_UPT_NB_BRANCH");
-
-	  if (_param->_have_port_depth[i])
-	  COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+    "_TAIL"     ,
-		                   dest, "in_DEPTH_"+toString(i)+"_UPT_TAIL"     );
-	}
-
+	  if (_param->_have_port_depth)
+            {
+	  PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_CURRENT",
+                              dest,"out_DEPTH_"+toString(i)+"_CURRENT");
+	  PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MIN",
+                              dest,"out_DEPTH_"+toString(i)+"_MIN");
+            }
+	  PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MAX",
+                              dest,"out_DEPTH_"+toString(i)+"_MAX");
+	}
+
+//       for (uint32_t i=0; i<_param->_nb_context; i++)
+// 	{
+// 	  dest = _name+"_prediction_unit_glue";
+	  
+// #ifdef POSITION
+// 	  _component->interface_map (src ,"depth_"+toString(i),
+// 				     dest,"depth_"+toString(i));
+// #endif
+	  
+// 	  COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+    "_NB_BRANCH",
+// 			           dest, "in_DEPTH_"+toString(i)+"_UPT_NB_BRANCH");
+
+// 	  if (_param->_have_port_depth)
+// 	  COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+    "_TAIL"     ,
+// 		                   dest, "in_DEPTH_"+toString(i)+"_UPT_TAIL"     );
+// 	}
     }
 
@@ -741,10 +765,10 @@
 	  PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_PC_NEXT_IS_DS_TAKE"         ,
 		              dest,"out_PREDICT_"+toString(i)+"_PC_NEXT_IS_DS_TAKE"         );
-	  if (_param->_have_port_inst_ifetch_ptr [i])
+	  if (_param->_have_port_inst_ifetch_ptr)
 	  PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_INST_IFETCH_PTR"            ,
 		              dest,"out_PREDICT_"+toString(i)+"_INST_IFETCH_PTR"            );
 	  PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_STATE"               ,
 		              dest,"out_PREDICT_"+toString(i)+"_BRANCH_STATE"               );
-	  if (_param->_have_port_depth [i])
+	  if (_param->_have_port_depth)
 	  PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID",
 		              dest,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID");
@@ -783,5 +807,5 @@
 	    PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_STATE"               ,
 		                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_STATE"               );
-	    if (_param->_have_port_max_depth)
+	    if (_param->_have_port_depth)
 	    PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID",
 		                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID");
@@ -796,23 +820,26 @@
 	  }
 
-      for (uint32_t i=0; i<_param->_nb_context; i++)
-	{
-	  dest = _name;
-#ifdef POSITION
-	  _component->interface_map (src ,"depth_"+toString(i),
-				     dest,"depth_"+toString(i));
-#endif
-	  
-	  PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_NB_BRANCH",dest,"out_DEPTH_"+toString(i)+"_NB_BRANCH");
-	  if (_param->_have_port_depth[i])
-	  PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_TAIL"     ,dest,"out_DEPTH_"+toString(i)+"_TAIL"     );
-	}
+//       for (uint32_t i=0; i<_param->_nb_context; i++)
+// 	{
+// 	  dest = _name;
+// #ifdef POSITION
+// 	  _component->interface_map (src ,"depth_"+toString(i),
+// 				     dest,"depth_"+toString(i));
+// #endif
+	  
+// 	  PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_NB_BRANCH",dest,"out_DEPTH_"+toString(i)+"_NB_BRANCH");
+// 	  if (_param->_have_port_depth)
+// 	  PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_TAIL"     ,dest,"out_DEPTH_"+toString(i)+"_TAIL"     );
+// 	}
     }
 
     // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
-    _component->test_map(false);
-
-#ifdef POSITION
-    _component->generate_file();
+#if DEBUG_Prediction_unit == true
+    _component->test_map();
+#endif
+
+#ifdef POSITION
+    if (usage_is_set(_usage,USE_POSITION))
+      _component->generate_file();
 #endif
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_deallocation.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_deallocation.cpp	(revision 88)
@@ -23,5 +23,5 @@
     log_printf(FUNC,Prediction_unit,FUNCTION,"Begin");
 
-    if (_usage & USE_SYSTEMC)
+    if (usage_is_set(_usage,USE_SYSTEMC))
       {
 	delete    in_CLOCK ;
@@ -30,46 +30,47 @@
 	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_PREVIOUS                ,_param->_nb_context,_param->_size_instruction_address);
+	DELETE1_SIGNAL( in_PREDICT_PC_CURRENT                 ,_param->_nb_context,_param->_size_instruction_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                    ,_param->_nb_context,_param->_size_instruction_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_INST_IFETCH_PTR            ,_param->_nb_context,_param->_size_inst_ifetch_ptr);
 	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]);
+	DELETE1_SIGNAL(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_context,_param->_size_depth );
 
-	DELETE2_SIGNAL(out_PREDICT_INSTRUCTION_ENABLE       ,_param->_nb_context,_param->_nb_instruction[alloc_signal_it1],1);
-	DELETE2_SIGNAL( in_DECOD_VAL                        ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],1);
-	DELETE2_SIGNAL(out_DECOD_ACK                        ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],1);
-	DELETE2_SIGNAL( in_DECOD_CONTEXT_ID                 ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],_param->_size_context_id      );
-	DELETE2_SIGNAL( in_DECOD_MATCH_INST_IFETCH_PTR      ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],1                             );
-	DELETE2_SIGNAL( in_DECOD_BRANCH_STATE               ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],_param->_size_branch_state    );
-	DELETE2_SIGNAL( in_DECOD_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],_param->_max_size_depth       );
-	DELETE2_SIGNAL( in_DECOD_BRANCH_CONDITION           ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],_param->_size_branch_condition);
-	DELETE2_SIGNAL( in_DECOD_BRANCH_DIRECTION           ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],1                             );
-	DELETE2_SIGNAL( in_DECOD_ADDRESS_SRC                ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],_param->_size_address         );
-	DELETE2_SIGNAL( in_DECOD_ADDRESS_DEST               ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],_param->_size_address         );
+	DELETE2_SIGNAL(out_PREDICT_INSTRUCTION_ENABLE       ,_param->_nb_context,_param->_nb_instruction[it1],1);
+	DELETE2_SIGNAL( in_DECOD_VAL                        ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],1);
+	DELETE2_SIGNAL(out_DECOD_ACK                        ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],1);
+	DELETE2_SIGNAL( in_DECOD_CONTEXT_ID                 ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],_param->_size_context_id      );
+	DELETE2_SIGNAL( in_DECOD_MATCH_INST_IFETCH_PTR      ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],1                             );
+	DELETE2_SIGNAL( in_DECOD_BRANCH_STATE               ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],_param->_size_branch_state    );
+	DELETE2_SIGNAL( in_DECOD_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],_param->_size_depth           );
+	DELETE2_SIGNAL( in_DECOD_BRANCH_CONDITION           ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],_param->_size_branch_condition);
+	DELETE2_SIGNAL( in_DECOD_BRANCH_DIRECTION           ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],1                             );
+	DELETE2_SIGNAL( in_DECOD_ADDRESS_SRC                ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],_param->_size_instruction_address         );
+	DELETE2_SIGNAL( in_DECOD_ADDRESS_DEST               ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],_param->_size_instruction_address         );
       
         DELETE1_SIGNAL( in_BRANCH_COMPLETE_VAL            ,_param->_nb_inst_branch_complete,1);
         DELETE1_SIGNAL(out_BRANCH_COMPLETE_ACK            ,_param->_nb_inst_branch_complete,1);
         DELETE1_SIGNAL( in_BRANCH_COMPLETE_CONTEXT_ID     ,_param->_nb_inst_branch_complete,_param->_size_context_id);
-        DELETE1_SIGNAL( in_BRANCH_COMPLETE_DEPTH          ,_param->_nb_inst_branch_complete,_param->_max_size_depth);
-        DELETE1_SIGNAL( in_BRANCH_COMPLETE_ADDRESS        ,_param->_nb_inst_branch_complete,_param->_size_address);
+        DELETE1_SIGNAL( in_BRANCH_COMPLETE_DEPTH          ,_param->_nb_inst_branch_complete,_param->_size_depth);
+        DELETE1_SIGNAL( in_BRANCH_COMPLETE_ADDRESS        ,_param->_nb_inst_branch_complete,_param->_size_instruction_address);
         DELETE1_SIGNAL( in_BRANCH_COMPLETE_FLAG           ,_param->_nb_inst_branch_complete,1);
         DELETE1_SIGNAL(out_BRANCH_COMPLETE_MISS_PREDICTION,_param->_nb_inst_branch_complete,1);
         DELETE1_SIGNAL(out_BRANCH_COMPLETE_TAKE           ,_param->_nb_inst_branch_complete,1);
-        DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_SRC    ,_param->_nb_inst_branch_complete,_param->_size_address);
-        DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_DEST   ,_param->_nb_inst_branch_complete,_param->_size_address);
+        DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_SRC    ,_param->_nb_inst_branch_complete,_param->_size_instruction_address);
+        DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_DEST   ,_param->_nb_inst_branch_complete,_param->_size_instruction_address);
 
         DELETE1_SIGNAL(out_BRANCH_EVENT_VAL            ,_param->_nb_context,1);
         DELETE1_SIGNAL( in_BRANCH_EVENT_ACK            ,_param->_nb_context,1);
 //      DELETE1_SIGNAL(out_BRANCH_EVENT_CONTEXT_ID     ,_param->_nb_context,_param->_size_context_id);
-//      DELETE1_SIGNAL(out_BRANCH_EVENT_DEPTH          ,_param->_nb_context,_param->_max_size_depth);
+//      DELETE1_SIGNAL(out_BRANCH_EVENT_DEPTH          ,_param->_nb_context,_param->_size_depth);
 //      DELETE1_SIGNAL(out_BRANCH_EVENT_MISS_PREDICTION,_param->_nb_context,1);
-        DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_SRC    ,_param->_nb_context,_param->_size_address);
-        DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_DEST   ,_param->_nb_context,_param->_size_address);
+        DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_SRC    ,_param->_nb_context,_param->_size_instruction_address);
+        DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_DEST   ,_param->_nb_context,_param->_size_instruction_address);
 
-        DELETE1_SIGNAL(out_DEPTH_NB_BRANCH    ,_param->_nb_context,_param->_size_depth[alloc_signal_it1]+1);
-        DELETE1_SIGNAL(out_DEPTH_TAIL         ,_param->_nb_context,_param->_size_depth[alloc_signal_it1]);
+        DELETE1_SIGNAL(out_DEPTH_CURRENT      ,_param->_nb_context,_param->_size_depth);
+        DELETE1_SIGNAL(out_DEPTH_MIN          ,_param->_nb_context,_param->_size_depth);
+        DELETE1_SIGNAL(out_DEPTH_MAX          ,_param->_nb_context,_param->_size_depth+1);
       }
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_end_cycle.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_end_cycle.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_end_cycle.cpp	(revision 88)
@@ -24,5 +24,6 @@
 
 #ifdef STATISTICS
-    _stat->end_cycle();
+    if (usage_is_set(_usage,USE_STATISTICS))
+      _stat->end_cycle();
 #endif    
 
@@ -30,5 +31,6 @@
     // Evaluation before read the ouput signal
 //  sc_start(0);
-    _interfaces->testbench();
+    if (usage_is_set(_usage,USE_VHDL_TESTBENCH))
+      _interfaces->testbench();
 #endif
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_statistics_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_statistics_allocation.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_statistics_allocation.cpp	(revision 88)
@@ -26,5 +26,11 @@
 		      "Prediction_unit",
 		      param_statistics);
-    
+
+    _stat->add_stat(_component_btb ->_stat);
+    _stat->add_stat(_component_dir ->_stat);
+    _stat->add_stat(_component_ras ->_stat);
+    _stat->add_stat(_component_upt ->_stat);
+    _stat->add_stat(_component_glue->_stat);
+        
     log_printf(FUNC,Prediction_unit,FUNCTION,"End");
   };
