Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Parameters.cpp	(revision 108)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Parameters.cpp	(revision 110)
@@ -7,4 +7,5 @@
 
 #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Parameters.h"
+#include "Behavioural/include/Allocation.h"
 #include "Common/include/Max.h"
 #include "Common/include/BitManipulation.h"
@@ -20,24 +21,26 @@
 #undef  FUNCTION
 #define FUNCTION "Commit_unit::Parameters"
-  Parameters::Parameters (uint32_t            nb_front_end            ,
-			  uint32_t          * nb_context              ,
-			  uint32_t            nb_rename_unit          ,
-			  uint32_t            size_queue              ,
-			  uint32_t            nb_bank                 ,
-			  uint32_t          * nb_inst_insert          ,
-			  uint32_t          * nb_inst_retire          ,
-			  uint32_t            nb_inst_commit          ,
-			  uint32_t            nb_inst_reexecute       ,
-			  uint32_t            nb_inst_branch_complete ,
-			  uint32_t         ** nb_branch_speculated    ,
-                          uint32_t            size_nb_inst_decod      ,
-			  uint32_t            size_general_data       ,
-			  uint32_t            size_store_queue_ptr    ,
-			  uint32_t            size_load_queue_ptr     ,
-			  uint32_t            size_general_register   ,
-			  uint32_t            size_special_register   ,
-			  Tpriority_t         priority                ,
-			  Tload_balancing_t   load_balancing          ,
-			  uint32_t            nb_rename_unit_select   ,
+  Parameters::Parameters (uint32_t            nb_front_end                       ,
+			  uint32_t          * nb_context                         ,
+			  uint32_t            nb_rename_unit                     ,
+			  uint32_t            size_queue                         ,
+			  uint32_t            nb_bank                            ,
+			  uint32_t          * nb_inst_insert                     ,
+			  uint32_t          * nb_inst_retire                     ,
+			  uint32_t            nb_inst_commit                     ,
+			  uint32_t            nb_inst_reexecute                  ,
+			  uint32_t            nb_inst_branch_complete            ,
+			  uint32_t         ** nb_branch_speculated               ,
+                          uint32_t            size_nb_inst_decod                 ,
+			  uint32_t            size_general_data                  ,
+			  uint32_t            size_store_queue_ptr               ,
+			  uint32_t            size_load_queue_ptr                ,
+			  uint32_t            size_general_register              ,
+			  uint32_t            size_special_register              ,
+			  Tpriority_t         priority                           ,
+			  Tload_balancing_t   load_balancing                     ,
+			  uint32_t            nb_rename_unit_select              ,
+                          uint32_t            nb_thread                          ,
+                          uint32_t         ** translate_num_context_to_num_thread,
                           bool                is_toplevel):
     _nb_bank_access_commit (1              ),
@@ -46,18 +49,20 @@
     log_begin(Commit_unit,FUNCTION);
 
-    _nb_front_end             = nb_front_end           ;
-    _nb_context               = nb_context             ;
-    _nb_rename_unit           = nb_rename_unit         ;
-    _size_queue               = size_queue             ;
-    _nb_bank                  = nb_bank                ;
-    _nb_inst_insert           = nb_inst_insert         ;
-    _nb_inst_retire           = nb_inst_retire         ;
-    _nb_inst_commit           = nb_inst_commit         ;
-    _nb_inst_reexecute        = nb_inst_reexecute      ;
-    _nb_inst_branch_complete  = nb_inst_branch_complete;
-    _nb_branch_speculated     = nb_branch_speculated   ;
-    _priority                 = priority               ;
-    _load_balancing           = load_balancing         ;
-    _nb_rename_unit_select    = nb_rename_unit_select  ;
+    _nb_front_end                        = nb_front_end                       ;
+    _nb_context                          = nb_context                         ;
+    _nb_rename_unit                      = nb_rename_unit                     ;
+    _size_queue                          = size_queue                         ;
+    _nb_bank                             = nb_bank                            ;
+    _nb_inst_insert                      = nb_inst_insert                     ;
+    _nb_inst_retire                      = nb_inst_retire                     ;
+    _nb_inst_commit                      = nb_inst_commit                     ;
+    _nb_inst_reexecute                   = nb_inst_reexecute                  ;
+    _nb_inst_branch_complete             = nb_inst_branch_complete            ;
+    _nb_branch_speculated                = nb_branch_speculated               ;
+    _priority                            = priority                           ;
+    _load_balancing                      = load_balancing                     ;
+    _nb_rename_unit_select               = nb_rename_unit_select              ;
+    _nb_thread                           = nb_thread                          ;
+    _translate_num_context_to_num_thread = translate_num_context_to_num_thread;
 
     _size_rename_unit_id      = log2(_nb_rename_unit);
@@ -71,13 +76,17 @@
     _have_port_rename_unit_id = _size_rename_unit_id > 0;
 
-    _array_size_depth               = new uint32_t * [_nb_front_end];
+    ALLOC2(_array_size_depth,uint32_t,_nb_front_end,_nb_context [it1]);
     for (uint32_t i=0; i<_nb_front_end; i++)
-      {
-	_array_size_depth      [i]      = new uint32_t [_nb_context [i]];
-	for (uint32_t j=0; j<_nb_context [i]; j++)
-          _array_size_depth      [i][j] = (_nb_branch_speculated [i][j] == 0)?0:log2(_nb_branch_speculated [i][j]);
-      }
+      for (uint32_t j=0; j<_nb_context [i]; j++)
+        _array_size_depth      [i][j] = (_nb_branch_speculated [i][j] == 0)?0:log2(_nb_branch_speculated [i][j]);
 
     test();
+
+    ALLOC1(_have_thread,bool,_nb_thread);
+    for (uint32_t i=0; i<_nb_thread; i++)
+      _have_thread[i] = false;
+    for (uint32_t i=0; i<_nb_front_end; i++)
+      for (uint32_t j=0; j<_nb_context [i]; j++)
+        _have_thread[_translate_num_context_to_num_thread [i][j]] = true;
 
     if (is_toplevel)
@@ -123,9 +132,6 @@
     log_begin(Commit_unit,FUNCTION);
 
-    for (uint32_t i=0; i<_nb_front_end; i++)
-      {
-	delete [] _array_size_depth [i];
-      }
-    delete [] _array_size_depth;
+    DELETE1(_have_thread     ,_nb_thread);
+    DELETE2(_array_size_depth,_nb_front_end,_nb_context [it1]);
 
     log_end(Commit_unit,FUNCTION);
