Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/test.cpp	(revision 5)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/test.cpp	(revision 44)
@@ -10,5 +10,5 @@
 
 #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/include/test.h"
-#include "Include/Test.h"
+#include "Common/include/Test.h"
 
 void test (string name,
@@ -28,4 +28,5 @@
    *********************************************************************/
   sc_clock                         * CLOCK;
+  sc_signal<Tcontrol_t>            * NRESET;
 
     // Interface Predict
@@ -65,5 +66,6 @@
 
 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
-  CLOCK                                  = new sc_clock ("clock", 1.0, 0.5);
+  CLOCK                             = new sc_clock ("clock", 1.0, 0.5);
+  NRESET                            = new sc_signal<Tcontrol_t> ("nreset");
 #endif  
 
@@ -170,4 +172,5 @@
 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
   (*(_Meta_Predictor_Glue->in_CLOCK))        (*(CLOCK));
+  (*(_Meta_Predictor_Glue->in_NRESET))        (*(NRESET));
 #endif
 
@@ -252,10 +255,11 @@
 
   sc_start(0);
-  _Meta_Predictor_Glue->vhdl_testbench_label("Initialisation");
   cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;
-  
+
+  NRESET->write(0);
+  sc_start(5);
+  NRESET->write(1);
   // No need initialisation
 
-  _Meta_Predictor_Glue->vhdl_testbench_label("Loop of Test");
   cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl;
   
@@ -282,7 +286,13 @@
 //uint32_t shift_6 = shift_5 + _param._predictor_2_pht_size_counter;
 
+  cout << "shift_0 : " << shift_0 << endl;
+  cout << "shift_1 : " << shift_1 << endl;
+  cout << "shift_2 : " << shift_2 << endl;
+  cout << "shift_3 : " << shift_3 << endl;
+  cout << "shift_4 : " << shift_4 << endl;
+  cout << "shift_5 : " << shift_5 << endl;
+
   for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
     {
-      _Meta_Predictor_Glue->vhdl_testbench_label("Iteration "+toString(iteration));
 
       for (uint32_t i=0; i<_param._nb_prediction; i++)
@@ -365,17 +375,30 @@
 	  BRANCH_COMPLETE_PREDICTOR_2_ACK         [i] ->write (predictor_2_ack);
 
-	  branch_complete_predictor_0_bht_history [i] = rand() % (_param._predictor_0_bht_size_shifter+1);
-	  branch_complete_predictor_0_pht_history [i] = rand() % (_param._predictor_0_pht_size_counter+1);
-	  branch_complete_predictor_1_bht_history [i] = rand() % (_param._predictor_1_bht_size_shifter+1);
-	  branch_complete_predictor_1_pht_history [i] = rand() % (_param._predictor_1_pht_size_counter+1);
-	  branch_complete_predictor_2_bht_history [i] = rand() % (_param._predictor_2_bht_size_shifter+1);
-	  branch_complete_predictor_2_pht_history [i] = rand() % (_param._predictor_2_pht_size_counter+1);
+	  branch_complete_predictor_0_bht_history [i] = rand() % (1<<_param._predictor_0_bht_size_shifter);
+	  branch_complete_predictor_0_pht_history [i] = rand() % (1<<_param._predictor_0_pht_size_counter);
+	  branch_complete_predictor_1_bht_history [i] = rand() % (1<<_param._predictor_1_bht_size_shifter);
+	  branch_complete_predictor_1_pht_history [i] = rand() % (1<<_param._predictor_1_pht_size_counter);
+	  branch_complete_predictor_2_bht_history [i] = rand() % (1<<_param._predictor_2_bht_size_shifter);
+	  branch_complete_predictor_2_pht_history [i] = rand() % (1<<_param._predictor_2_pht_size_counter);
 		
-	  BRANCH_COMPLETE_HISTORY                 [i]->write((branch_complete_predictor_0_bht_history [i] << shift_0) |
-							     (branch_complete_predictor_0_pht_history [i] << shift_1) |
-							     (branch_complete_predictor_1_bht_history [i] << shift_2) |
-							     (branch_complete_predictor_1_pht_history [i] << shift_3) |
-							     (branch_complete_predictor_2_bht_history [i] << shift_4) |
-							     (branch_complete_predictor_2_pht_history [i] << shift_5) );
+	  Thistory_t history = ((branch_complete_predictor_0_bht_history [i] << shift_0) |
+				(branch_complete_predictor_0_pht_history [i] << shift_1) |
+				(branch_complete_predictor_1_bht_history [i] << shift_2) |
+				(branch_complete_predictor_1_pht_history [i] << shift_3) |
+				(branch_complete_predictor_2_bht_history [i] << shift_4) |
+				(branch_complete_predictor_2_pht_history [i] << shift_5) );
+
+	  BRANCH_COMPLETE_HISTORY                 [i]->write (history);
+
+	  cout << "<test> [" << i << "] : " << endl
+	     << hex 
+	     << " *   " << history << endl
+	     << "   - " << branch_complete_predictor_0_bht_history [i] << endl
+	     << "   - " << branch_complete_predictor_0_pht_history [i] << endl
+	     << "   - " << branch_complete_predictor_1_bht_history [i] << endl
+	     << "   - " << branch_complete_predictor_1_pht_history [i] << endl
+	     << "   - " << branch_complete_predictor_2_bht_history [i] << endl
+	     << "   - " << branch_complete_predictor_2_pht_history [i] << endl
+	     << dec;
 
 	  Tcontrol_t direction_0 = ((_param._predictor_0_have_pht)?(branch_complete_predictor_0_pht_history [i] >> (_param._predictor_0_pht_size_counter-1)):(branch_complete_predictor_0_bht_history [i] >> (_param._predictor_0_bht_size_shifter-1)))&1;
