Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/src/test.cpp	(revision 105)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/src/test.cpp	(revision 106)
@@ -275,5 +275,5 @@
       for (uint32_t i=0; i<_param->_nb_context; i++)
 	if (_param->_have_port_depth)
-	  in_DEPTH_MIN  [i]->write((_param->_array_size_depth[i]==0)?0:(i%_param->_array_size_depth[i]));
+	  in_DEPTH_MIN  [i]->write((log2(_param->_nb_inst_branch_speculated[i])==0)?0:(i%log2(_param->_nb_inst_branch_speculated[i])));
       
       uint32_t context    = rand()%_param->_nb_context;
@@ -295,5 +295,5 @@
 	  in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdeadbeef);
 	  if (_param->_have_port_depth)
-	  in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
+	  in_DECOD_EVENT_DEPTH         [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
 	  in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_MSYNC);
 	  
@@ -350,5 +350,5 @@
 	  in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdeadbebe);
 	  if (_param->_have_port_depth)
-	  in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
+	  in_DECOD_EVENT_DEPTH         [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
 	  in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_PSYNC);
 	  
@@ -428,5 +428,5 @@
 	  in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdead0300);
 	  if (_param->_have_port_depth)
-	  in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
+	  in_DECOD_EVENT_DEPTH         [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
 	  in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_CSYNC);
 	  
@@ -507,5 +507,5 @@
 	  in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdead0400);
 	  if (_param->_have_port_depth)
-	  in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
+	  in_DECOD_EVENT_DEPTH         [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
 	  in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_SPR_ACCESS);
 	  
@@ -559,5 +559,5 @@
 // 	  in_BRANCH_COMPLETE_CONTEXT_ID       [port]->write(context);
 // 	  if (_param->_have_port_depth)
-// 	  in_BRANCH_COMPLETE_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
+// 	  in_BRANCH_COMPLETE_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
 // 	  in_BRANCH_COMPLETE_ADDRESS_SRC      [port]->write(0x400);
 // 	  in_BRANCH_COMPLETE_ADDRESS_DEST     [port]->write(0x500);
@@ -580,5 +580,5 @@
 	  
 	  if (_param->_have_port_depth)
-	  in_BRANCH_EVENT_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
+	  in_BRANCH_EVENT_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
 	  in_BRANCH_EVENT_ADDRESS_SRC      [port]->write(0x400);
 	  in_BRANCH_EVENT_ADDRESS_DEST     [port]->write(0x500);
@@ -649,5 +649,5 @@
 // 	  in_BRANCH_COMPLETE_CONTEXT_ID       [port]->write(context);
 // 	  if (_param->_have_port_depth)
-// 	  in_BRANCH_COMPLETE_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
+// 	  in_BRANCH_COMPLETE_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
 // 	  in_BRANCH_COMPLETE_ADDRESS_SRC      [port]->write(0x600);
 // 	  in_BRANCH_COMPLETE_ADDRESS_DEST     [port]->write(0x700);
@@ -669,5 +669,5 @@
 	  uint32_t port = context;
 	  
-	  in_BRANCH_EVENT_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
+	  in_BRANCH_EVENT_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
 	  in_BRANCH_EVENT_ADDRESS_SRC      [port]->write(0x600);
 	  in_BRANCH_EVENT_ADDRESS_DEST     [port]->write(0x700);
@@ -736,5 +736,5 @@
 	  in_DECOD_EVENT_CONTEXT_ID       [port]->write(context);
 	  if (_param->_have_port_depth)
-	  in_DECOD_EVENT_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
+	  in_DECOD_EVENT_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
 	  in_DECOD_EVENT_TYPE             [port]->write(EVENT_TYPE_EXCEPTION);
 	  in_DECOD_EVENT_IS_DELAY_SLOT    [port]->write(0);
@@ -830,5 +830,5 @@
 	  in_DECOD_EVENT_CONTEXT_ID       [port]->write(context);
 	  if (_param->_have_port_depth)
-	  in_DECOD_EVENT_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
+	  in_DECOD_EVENT_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
 	  in_DECOD_EVENT_TYPE             [port]->write(EVENT_TYPE_EXCEPTION);
 	  in_DECOD_EVENT_IS_DELAY_SLOT    [port]->write(1);
@@ -922,5 +922,5 @@
 	  in_COMMIT_EVENT_CONTEXT_ID       ->write(context);
 	  if (_param->_have_port_depth)
-	  in_COMMIT_EVENT_DEPTH            ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
+	  in_COMMIT_EVENT_DEPTH            ->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
 	  in_COMMIT_EVENT_TYPE             ->write(EVENT_TYPE_EXCEPTION);
 	  in_COMMIT_EVENT_IS_DELAY_SLOT    ->write(0);
@@ -1017,5 +1017,5 @@
 	  in_COMMIT_EVENT_CONTEXT_ID       ->write(context);
 	  if (_param->_have_port_depth)
-	  in_COMMIT_EVENT_DEPTH            ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
+	  in_COMMIT_EVENT_DEPTH            ->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
 	  in_COMMIT_EVENT_TYPE             ->write(EVENT_TYPE_EXCEPTION);
 	  in_COMMIT_EVENT_IS_DELAY_SLOT    ->write(1);
@@ -1112,5 +1112,5 @@
 	  in_COMMIT_EVENT_CONTEXT_ID       ->write(context);
 	  if (_param->_have_port_depth)
-	  in_COMMIT_EVENT_DEPTH            ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
+	  in_COMMIT_EVENT_DEPTH            ->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
 	  in_COMMIT_EVENT_TYPE             ->write(EVENT_TYPE_EXCEPTION);
 	  in_COMMIT_EVENT_IS_DELAY_SLOT    ->write(0);
@@ -1207,5 +1207,5 @@
 	  in_COMMIT_EVENT_CONTEXT_ID       ->write(context);
 	  if (_param->_have_port_depth)
-	  in_COMMIT_EVENT_DEPTH            ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
+	  in_COMMIT_EVENT_DEPTH            ->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
 	  in_COMMIT_EVENT_TYPE             ->write(EVENT_TYPE_EXCEPTION);
 	  in_COMMIT_EVENT_IS_DELAY_SLOT    ->write(1);
