Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/src/Register_unit_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/src/Register_unit_allocation.cpp	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/src/Register_unit_allocation.cpp	(revision 112)
@@ -7,4 +7,5 @@
 
 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/include/Register_unit.h"
+#include "Behavioural/include/Allocation.h"
 
 namespace morpheo {
@@ -52,150 +53,70 @@
 
     // ~~~~~[ Interface "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-    in_GPR_READ_VAL                 = new SC_IN (Tcontrol_t        )   * [_param->_nb_gpr_read];
-    out_GPR_READ_ACK                 = new SC_OUT(Tcontrol_t        )   * [_param->_nb_gpr_read];
-    if (_param->_have_port_ooo_engine_id == true)
-      in_GPR_READ_OOO_ENGINE_ID       = new SC_IN (Tcontext_t        )   * [_param->_nb_gpr_read];
-    in_GPR_READ_NUM_REG             = new SC_IN (Tgeneral_address_t)   * [_param->_nb_gpr_read];
-    out_GPR_READ_DATA                = new SC_OUT(Tgeneral_data_t   )   * [_param->_nb_gpr_read];
-    out_GPR_READ_DATA_VAL            = new SC_OUT(Tcontrol_t        )   * [_param->_nb_gpr_read];
-     
-    for (uint32_t i=0; i<_param->_nb_gpr_read; i++)
-      {
-	Interface_fifo * interface = _interfaces->set_interface("gpr_read_"+toString(i)
-#ifdef POSITION
-								,IN
-								,NORTH
-								,"Interface to read the register file"
-#endif
-								);
-	 
-	in_GPR_READ_VAL           [i]= interface->set_signal_valack_in  (VAL);
-	out_GPR_READ_ACK           [i]= interface->set_signal_valack_out (ACK);
-	if (_param->_have_port_ooo_engine_id == true)
-	  in_GPR_READ_OOO_ENGINE_ID [i]= interface->set_signal_in <Tcontext_t        > ("ooo_engine_id" , _param->_size_ooo_engine_id);
-	in_GPR_READ_NUM_REG       [i]= interface->set_signal_in <Tgeneral_address_t> ("num_reg"       , _param->_size_gpr_address);
-	out_GPR_READ_DATA          [i]= interface->set_signal_out<Tgeneral_data_t   > ("data"          , _param->_size_general_data);
-	out_GPR_READ_DATA_VAL      [i]= interface->set_signal_out<Tcontrol_t        > ("data_val"      , 1);
-      }
+    {
+      ALLOC1_INTERFACE_BEGIN("gpr_read",IN,NORTH,_("Interface to read the register file"),_param->_nb_gpr_read);
+      
+      ALLOC1_VALACK_IN ( in_GPR_READ_VAL          ,VAL);
+      ALLOC1_VALACK_OUT(out_GPR_READ_ACK          ,ACK);
+      ALLOC1_SIGNAL_IN ( in_GPR_READ_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id);
+      ALLOC1_SIGNAL_IN ( in_GPR_READ_NUM_REG      ,"num_reg"      ,Tgeneral_address_t,_param->_size_gpr_address);
+      ALLOC1_SIGNAL_OUT(out_GPR_READ_DATA         ,"data"         ,Tgeneral_data_t   ,_param->_size_general_data);
+      ALLOC1_SIGNAL_OUT(out_GPR_READ_DATA_VAL     ,"data_val"     ,Tcontrol_t        ,1);
+
+      ALLOC1_INTERFACE_END(_param->_nb_gpr_read);
+    }
 
     // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-    in_GPR_WRITE_VAL                 = new SC_IN (Tcontrol_t        )   * [_param->_nb_gpr_write];
-    out_GPR_WRITE_ACK                 = new SC_OUT(Tcontrol_t        )   * [_param->_nb_gpr_write];
-    if (_param->_have_port_ooo_engine_id == true)
-      in_GPR_WRITE_OOO_ENGINE_ID       = new SC_IN (Tcontext_t        )   * [_param->_nb_gpr_write];
-    in_GPR_WRITE_NUM_REG             = new SC_IN (Tgeneral_address_t)   * [_param->_nb_gpr_write];
-    in_GPR_WRITE_DATA                = new SC_IN (Tgeneral_data_t   )   * [_param->_nb_gpr_write];
-     
-    for (uint32_t i=0; i<_param->_nb_gpr_write; i++)
-      {
-	Interface_fifo * interface = _interfaces->set_interface("gpr_write_"+toString(i)
-#ifdef POSITION
-								,IN
-								,NORTH,
-								"Interface to write the register file"
-#endif
-								);
-	 
-	in_GPR_WRITE_VAL           [i]= interface->set_signal_valack_in  (VAL);
-	out_GPR_WRITE_ACK           [i]= interface->set_signal_valack_out (ACK);
-	if (_param->_have_port_ooo_engine_id == true)
-	  in_GPR_WRITE_OOO_ENGINE_ID [i]= interface->set_signal_in <Tcontext_t        > ("ooo_engine_id" , _param->_size_ooo_engine_id);
-	in_GPR_WRITE_NUM_REG       [i]= interface->set_signal_in <Tgeneral_address_t> ("num_reg"       , _param->_size_gpr_address);
-	in_GPR_WRITE_DATA          [i]= interface->set_signal_in <Tgeneral_data_t   > ("data"          , _param->_size_general_data);
-      }
+    {
+      ALLOC1_INTERFACE_BEGIN("gpr_write",IN,NORTH,_("Interface to write the register file"),_param->_nb_gpr_write);
+
+      ALLOC1_VALACK_IN ( in_GPR_WRITE_VAL          ,VAL);
+      ALLOC1_VALACK_OUT(out_GPR_WRITE_ACK          ,ACK);
+      ALLOC1_SIGNAL_IN ( in_GPR_WRITE_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id);
+      ALLOC1_SIGNAL_IN ( in_GPR_WRITE_NUM_REG      ,"num_reg"      ,Tgeneral_address_t,_param->_size_gpr_address);
+      ALLOC1_SIGNAL_IN ( in_GPR_WRITE_DATA         ,"data"         ,Tgeneral_data_t   ,_param->_size_general_data);
+
+      ALLOC1_INTERFACE_END(_param->_nb_gpr_write);
+    }
 
     // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-    in_SPR_READ_VAL                 = new SC_IN (Tcontrol_t        )   * [_param->_nb_spr_read];
-    out_SPR_READ_ACK                 = new SC_OUT(Tcontrol_t        )   * [_param->_nb_spr_read];
-    if (_param->_have_port_ooo_engine_id == true)
-      in_SPR_READ_OOO_ENGINE_ID       = new SC_IN (Tcontext_t        )   * [_param->_nb_spr_read];
-    in_SPR_READ_NUM_REG             = new SC_IN (Tspecial_address_t)   * [_param->_nb_spr_read];
-    out_SPR_READ_DATA                = new SC_OUT(Tspecial_data_t   )   * [_param->_nb_spr_read];
-    out_SPR_READ_DATA_VAL            = new SC_OUT(Tcontrol_t        )   * [_param->_nb_spr_read];
-     
-    for (uint32_t i=0; i<_param->_nb_spr_read; i++)
-      {
-	Interface_fifo * interface = _interfaces->set_interface("spr_read_"+toString(i)
-#ifdef POSITION
-								,IN
-								,NORTH,
-								"Interface to read the register file"
-#endif
-								);
-	 
-	in_SPR_READ_VAL           [i]= interface->set_signal_valack_in  (VAL);
-	out_SPR_READ_ACK           [i]= interface->set_signal_valack_out (ACK);
-	if (_param->_have_port_ooo_engine_id == true)
-	  in_SPR_READ_OOO_ENGINE_ID [i]= interface->set_signal_in <Tcontext_t        > ("ooo_engine_id" , _param->_size_ooo_engine_id);
-	in_SPR_READ_NUM_REG       [i]= interface->set_signal_in <Tspecial_address_t> ("num_reg"       , _param->_size_spr_address);
-	out_SPR_READ_DATA          [i]= interface->set_signal_out<Tspecial_data_t   > ("data"          , _param->_size_special_data);
-	out_SPR_READ_DATA_VAL      [i]= interface->set_signal_out<Tcontrol_t        > ("data_val"      , 1);
-      }
+    {
+      ALLOC1_INTERFACE_BEGIN("spr_read",IN,NORTH,_("Interface to read the register file"),_param->_nb_spr_read);
+      
+      ALLOC1_VALACK_IN ( in_SPR_READ_VAL          ,VAL);
+      ALLOC1_VALACK_OUT(out_SPR_READ_ACK          ,ACK);
+      ALLOC1_SIGNAL_IN ( in_SPR_READ_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id);
+      ALLOC1_SIGNAL_IN ( in_SPR_READ_NUM_REG      ,"num_reg"      ,Tspecial_address_t,_param->_size_spr_address);
+      ALLOC1_SIGNAL_OUT(out_SPR_READ_DATA         ,"data"         ,Tspecial_data_t   ,_param->_size_special_data);
+      ALLOC1_SIGNAL_OUT(out_SPR_READ_DATA_VAL     ,"data_val"     ,Tcontrol_t        ,1);
+
+      ALLOC1_INTERFACE_END(_param->_nb_spr_read);
+    }
 
     // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-    in_SPR_WRITE_VAL                 = new SC_IN (Tcontrol_t        )   * [_param->_nb_spr_write];
-    out_SPR_WRITE_ACK                 = new SC_OUT(Tcontrol_t        )   * [_param->_nb_spr_write];
-    if (_param->_have_port_ooo_engine_id == true)
-      in_SPR_WRITE_OOO_ENGINE_ID       = new SC_IN (Tcontext_t        )   * [_param->_nb_spr_write];
-    in_SPR_WRITE_NUM_REG             = new SC_IN (Tspecial_address_t)   * [_param->_nb_spr_write];
-    in_SPR_WRITE_DATA                = new SC_IN (Tspecial_data_t   )   * [_param->_nb_spr_write];
-     
-    for (uint32_t i=0; i<_param->_nb_spr_write; i++)
-      {
-	Interface_fifo * interface = _interfaces->set_interface("spr_write_"+toString(i)
-#ifdef POSITION
-								,IN
-								,NORTH,
-								"Interface to write the register file"
-#endif
-								);
-	 
-	in_SPR_WRITE_VAL           [i]= interface->set_signal_valack_in  (VAL);
-	out_SPR_WRITE_ACK           [i]= interface->set_signal_valack_out (ACK);
-	if (_param->_have_port_ooo_engine_id == true)
-	  in_SPR_WRITE_OOO_ENGINE_ID [i]= interface->set_signal_in <Tcontext_t        > ("ooo_engine_id" , _param->_size_ooo_engine_id);
-	in_SPR_WRITE_NUM_REG       [i]= interface->set_signal_in <Tspecial_address_t> ("num_reg"       , _param->_size_spr_address);
-	in_SPR_WRITE_DATA          [i]= interface->set_signal_in <Tspecial_data_t   > ("data"          , _param->_size_special_data);
-      }
-
-    // ~~~~~[ Interface "insert_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-    in_INSERT_ROB_VAL        = new SC_IN (Tcontrol_t        )  ** [_param->_nb_ooo_engine];
-    out_INSERT_ROB_ACK        = new SC_OUT(Tcontrol_t        )  ** [_param->_nb_ooo_engine];
-    in_INSERT_ROB_RD_USE     = new SC_IN (Tcontrol_t        )  ** [_param->_nb_ooo_engine];
-    in_INSERT_ROB_RD_NUM_REG = new SC_IN (Tgeneral_address_t)  ** [_param->_nb_ooo_engine];
-    in_INSERT_ROB_RE_USE     = new SC_IN (Tcontrol_t        )  ** [_param->_nb_ooo_engine];
-    in_INSERT_ROB_RE_NUM_REG = new SC_IN (Tspecial_address_t)  ** [_param->_nb_ooo_engine];
-
-    for (uint32_t i=0; i<_param->_nb_ooo_engine; i++)
-      {
-	uint32_t x=_param->_nb_inst_insert_rob [i];
-
-	in_INSERT_ROB_VAL        [i] = new SC_IN (Tcontrol_t        )  * [x];
-	out_INSERT_ROB_ACK        [i] = new SC_OUT(Tcontrol_t        )  * [x];
-	in_INSERT_ROB_RD_USE     [i] = new SC_IN (Tcontrol_t        )  * [x];
-	in_INSERT_ROB_RD_NUM_REG [i] = new SC_IN (Tgeneral_address_t)  * [x];
-	in_INSERT_ROB_RE_USE     [i] = new SC_IN (Tcontrol_t        )  * [x];
-	in_INSERT_ROB_RE_NUM_REG [i] = new SC_IN (Tspecial_address_t)  * [x];
-
-	for (uint32_t j=0; j<x; j++)
-	  {
-	    Interface_fifo * interface = _interfaces->set_interface("insert_rob_"+toString(i)+"_"+toString(j)
-#ifdef POSITION
-								    ,IN
-								    ,WEST
-								    ,"Interface to update status (insert)"
-#endif
-								    );
-
-
-	    in_INSERT_ROB_VAL        [i][j] = interface->set_signal_valack_in  (VAL);
-	    out_INSERT_ROB_ACK        [i][j] = interface->set_signal_valack_out (ACK);
-	    in_INSERT_ROB_RD_USE     [i][j] = interface->set_signal_in <Tcontrol_t        > ("rd_use"    , 1);
-	    in_INSERT_ROB_RD_NUM_REG [i][j] = interface->set_signal_in <Tgeneral_address_t> ("rd_num_reg", _param->_size_gpr_address);
-	    in_INSERT_ROB_RE_USE     [i][j] = interface->set_signal_in <Tcontrol_t        > ("re_use"    , 1);
-	    in_INSERT_ROB_RE_NUM_REG [i][j] = interface->set_signal_in <Tspecial_address_t> ("re_num_reg", _param->_size_spr_address);
-	     
-	  }
-      }
+    {
+      ALLOC1_INTERFACE_BEGIN("spr_write",IN,NORTH,_("Interface to write the register file"),_param->_nb_spr_write);
+
+      ALLOC1_VALACK_IN ( in_SPR_WRITE_VAL          ,VAL);
+      ALLOC1_VALACK_OUT(out_SPR_WRITE_ACK          ,ACK);
+      ALLOC1_SIGNAL_IN ( in_SPR_WRITE_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id);
+      ALLOC1_SIGNAL_IN ( in_SPR_WRITE_NUM_REG      ,"num_reg"      ,Tspecial_address_t,_param->_size_spr_address);
+      ALLOC1_SIGNAL_IN ( in_SPR_WRITE_DATA         ,"data"         ,Tspecial_data_t   ,_param->_size_special_data);
+
+      ALLOC1_INTERFACE_END(_param->_nb_spr_write);
+    }
+
+    // ~~~~~[ Interface "insert_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      ALLOC2_INTERFACE_BEGIN("insert_rob",IN,WEST,_("Interface to update status (insert)"),_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
+      
+      _ALLOC2_VALACK_IN ( in_INSERT_ROB_VAL       ,VAL                                                      ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
+      _ALLOC2_VALACK_OUT(out_INSERT_ROB_ACK       ,ACK                                                      ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
+      _ALLOC2_SIGNAL_IN ( in_INSERT_ROB_RD_USE    ,"rd_use"    ,Tcontrol_t        ,1                        ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
+      _ALLOC2_SIGNAL_IN ( in_INSERT_ROB_RD_NUM_REG,"rd_num_reg",Tgeneral_address_t,_param->_size_gpr_address,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
+      _ALLOC2_SIGNAL_IN ( in_INSERT_ROB_RE_USE    ,"re_use"    ,Tcontrol_t        ,1                        ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
+      _ALLOC2_SIGNAL_IN ( in_INSERT_ROB_RE_NUM_REG,"re_num_reg",Tspecial_address_t,_param->_size_spr_address,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
+      
+      ALLOC2_INTERFACE_END(_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
+    }
 
 //     // ~~~~~[ Interface "retire_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
