Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/RegisterFile_Multi_Banked_Glue/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/RegisterFile_Multi_Banked_Glue/src/Parameters.cpp	(revision 15)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/RegisterFile_Multi_Banked_Glue/src/Parameters.cpp	(revision 23)
@@ -31,5 +31,5 @@
     _nb_port_write_by_bank (nb_port_write_by_bank),
     _crossbar              (crossbar             ),
-    _shift_address         (static_cast<uint32_t>(ceil(log2(_nb_bank))))
+    _shift_address         (_size_address-static_cast<uint32_t>(ceil(log2(_nb_bank))))
   {
     log_printf(FUNC,RegisterFile_Multi_Banked_Glue,"Parameters","Begin");
@@ -39,46 +39,37 @@
 	// All port_src is connected with one port_dest on each bank
 	
-	_link_port_read  = new uint32_t [_nb_port_read ];
-	for (uint32_t i=0; i<_nb_port_read ; i++)
-	  _link_port_read  [i] = i%_nb_port_read_by_bank;
+	_link_port_read_in_to_out          = new uint32_t [_nb_port_read ];
+	_link_port_read_in_to_select       = new uint32_t [_nb_port_read ];
+	_link_port_write_in_to_out         = new uint32_t [_nb_port_write];
+	_link_port_write_in_to_select      = new uint32_t [_nb_port_write];
+	uint32_t _nb_port_select_by_bank_read_port  [_nb_port_read_by_bank ];
+	uint32_t _nb_port_select_by_bank_write_port [_nb_port_write_by_bank];
+	
+	// init
+	for (uint32_t i=0; i<_nb_port_read_by_bank ;i++)
+	  _nb_port_select_by_bank_read_port  [i] = 0;
+	
+	for (uint32_t i=0; i<_nb_port_read         ;i++)
+	  {
+	    uint32_t x = i%_nb_port_read_by_bank;
+	    _link_port_read_in_to_out          [i] = x;
+	    _link_port_read_in_to_select       [i] = _nb_port_select_by_bank_read_port [x];
+	    _nb_port_select_by_bank_read_port  [x] ++;
+	  }
 
-	_link_port_write = new uint32_t [_nb_port_write];
-	for (uint32_t i=0; i<_nb_port_write; i++)
-	  _link_port_write [i] = i%_nb_port_write_by_bank;
+	// init
+	for (uint32_t i=0; i<_nb_port_write_by_bank ;i++)
+	  _nb_port_select_by_bank_write_port [i] = 0;
+	
+	for (uint32_t i=0; i<_nb_port_write         ;i++)
+	  {
+	    uint32_t x = i%_nb_port_write_by_bank;
+	    _link_port_write_in_to_out         [i] = x;
+	    _link_port_write_in_to_select      [i] = _nb_port_select_by_bank_write_port [x];
+	    _nb_port_select_by_bank_write_port [x] ++;
+	  }
       }
     // else : don't allocate
 
-    _nb_port_select_by_bank_read_port  = new uint32_t [_nb_port_read_by_bank ];
-    
-    if (_crossbar == FULL_CROSSBAR)
-      // All port_src is connected with all port_dest on each bank
-      for (uint32_t i=0; i<_nb_port_read_by_bank ;i++)
-	_nb_port_select_by_bank_read_port [i] = _nb_port_read;
-    else
-      // All port_src is connected with one port_dest on each bank
-      {
-	for (uint32_t i=0; i<_nb_port_read_by_bank ;i++)
-	  _nb_port_select_by_bank_read_port [i] = 0;
-
-	for (uint32_t i=0; i<_nb_port_read         ;i++)
-	  _nb_port_select_by_bank_read_port [_link_port_read [i]] ++;
-      }
-    
-    _nb_port_select_by_bank_write_port = new uint32_t [_nb_port_write_by_bank];
-
-    if (_crossbar == FULL_CROSSBAR)
-      // All port_src is connected with all port_dest on each bank
-      for (uint32_t i=0; i<_nb_port_write_by_bank ;i++)
-	_nb_port_select_by_bank_write_port [i] = _nb_port_write;
-    else
-      // All port_src is connected with one port_dest on each bank
-      {
-	for (uint32_t i=0; i<_nb_port_write_by_bank ;i++)
-	  _nb_port_select_by_bank_write_port [i] = 0;
-
-	for (uint32_t i=0; i<_nb_port_write         ;i++)
-	  _nb_port_select_by_bank_write_port [_link_port_write[i]] ++;
-      }
-    
     test();
     log_printf(FUNC,RegisterFile_Multi_Banked_Glue,"Parameters","End");
@@ -97,13 +88,4 @@
    {
     log_printf(FUNC,RegisterFile_Multi_Banked_Glue,"Parameters (copy)","Begin");
-
-    _nb_port_select_by_bank_read_port  = new uint32_t [_nb_port_read_by_bank ];
-    for (uint32_t i=0; i<_nb_port_read_by_bank; i++)
-      _nb_port_select_by_bank_read_port [i] = param._nb_port_select_by_bank_read_port [i];
-    
-    _nb_port_select_by_bank_write_port = new uint32_t [_nb_port_write_by_bank ];
-    for (uint32_t i=0; i<_nb_port_write_by_bank; i++)
-      _nb_port_select_by_bank_write_port[i] = param._nb_port_select_by_bank_write_port [i];
-    
     test();
     log_printf(FUNC,RegisterFile_Multi_Banked_Glue,"Parameters (copy)","End");
