Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_vhdl_body.cpp	(revision 15)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_vhdl_body.cpp	(revision 42)
@@ -15,27 +15,27 @@
 namespace victim_pseudo_lru {
 
-  void Victim_Pseudo_LRU::vhdl_body (Vhdl & vhdl)
+  void Victim_Pseudo_LRU::vhdl_body (Vhdl * & vhdl)
   {
-    vhdl.set_body ("");
-    vhdl.set_body ("-----------------------------------------------------------------------------");
-    vhdl.set_body ("-- Access");
-    vhdl.set_body ("-----------------------------------------------------------------------------");
-    vhdl.set_body ("");
-    vhdl.set_body ("-- Tree of Pseudo-LRU - example to 8 entity");
-    vhdl.set_body ("--");
-    vhdl.set_body ("--                4-5-6-7?              ");
-    vhdl.set_body ("--           0_______|_______1	    ");
-    vhdl.set_body ("--           |               |	    ");
-    vhdl.set_body ("--          2-3?            6-7?        ");
-    vhdl.set_body ("--       0___|___1       0___|___1      ");
-    vhdl.set_body ("--       |       |       |       |      ");
-    vhdl.set_body ("--       1?      3?      5?      7?     ");
-    vhdl.set_body ("--     0_|_1   0_|_1   0_|_1   0_|_1    ");
-    vhdl.set_body ("--     |   |   |   |   |   |   |   |    ");
-    vhdl.set_body ("--    Way Way Way Way Way Way Way Way   ");
-    vhdl.set_body ("--     0   1   2   3   4   5   6   7    ");
-    for (uint32_t i=0; i<_param._nb_access; i++)
-      {
-	vhdl.set_body ("");
+    vhdl->set_body ("");
+    vhdl->set_body ("-----------------------------------------------------------------------------");
+    vhdl->set_body ("-- Access");
+    vhdl->set_body ("-----------------------------------------------------------------------------");
+    vhdl->set_body ("");
+    vhdl->set_body ("-- Tree of Pseudo-LRU - example to 8 entity");
+    vhdl->set_body ("--");
+    vhdl->set_body ("--                4-5-6-7?              ");
+    vhdl->set_body ("--           0_______|_______1	    ");
+    vhdl->set_body ("--           |               |	    ");
+    vhdl->set_body ("--          2-3?            6-7?        ");
+    vhdl->set_body ("--       0___|___1       0___|___1      ");
+    vhdl->set_body ("--       |       |       |       |      ");
+    vhdl->set_body ("--       1?      3?      5?      7?     ");
+    vhdl->set_body ("--     0_|_1   0_|_1   0_|_1   0_|_1    ");
+    vhdl->set_body ("--     |   |   |   |   |   |   |   |    ");
+    vhdl->set_body ("--    Way Way Way Way Way Way Way Way   ");
+    vhdl->set_body ("--     0   1   2   3   4   5   6   7    ");
+    for (uint32_t i=0; i<_param._nb_access; i++)
+      {
+	vhdl->set_body ("");
 	// Read the table
 	
@@ -43,14 +43,14 @@
 
 	if (_param._size_table>1)
-	  access_address = "conv_integer(in_ACCESS_ADDRESS_"+toString(i)+")";
+	  access_address = "conv_integer(in_ACCESS_"+toString(i)+"_ADDRESS)";
 	else
 	  access_address = "0";
 
-	vhdl.set_body ("access_entry_"+toString(i)+" <= reg_TABLE ("+access_address+");");
-	vhdl.set_body ("");
+	vhdl->set_body ("access_entry_"+toString(i)+" <= reg_TABLE ("+access_address+");");
+	vhdl->set_body ("");
 
 	for (int32_t j=static_cast<uint32_t>(log2(_param._nb_entity)-1); j>=0; j--)
 	  {
- 	    vhdl.set_body ("access_entity_"+toString(i)+"("+toString(j)+") <= ");
+ 	    vhdl->set_body ("access_entity_"+toString(i)+"("+toString(j)+") <= ");
 
 	    uint32_t cpt=0;
@@ -72,17 +72,17 @@
 		string print_else = (k==(1<<j)-1)?"     ":"else ";
 
-		vhdl.set_body ("\t"+print_else+"access_entry_"+toString(i)+"("+toString(k)+") "+cond);
+		vhdl->set_body ("\t"+print_else+"access_entry_"+toString(i)+"("+toString(k)+") "+cond);
 		cpt ++;
 	      }
-	    vhdl.set_body ("\t;");
+	    vhdl->set_body ("\t;");
 	  }
       }
 
-    vhdl.set_body ("");
-    vhdl.set_body ("-----------------------------------------------------------------------------");
-    vhdl.set_body ("-- Update");
-    vhdl.set_body ("-----------------------------------------------------------------------------");
-    vhdl.set_body ("");
-    vhdl.set_body ("-- port access");
+    vhdl->set_body ("");
+    vhdl->set_body ("-----------------------------------------------------------------------------");
+    vhdl->set_body ("-- Update");
+    vhdl->set_body ("-----------------------------------------------------------------------------");
+    vhdl->set_body ("");
+    vhdl->set_body ("-- port access");
     for (uint32_t i=0; i<_param._nb_access; i++)
       for (int32_t j=static_cast<uint32_t>(log2(_param._nb_entity)-1); j>=0; j--)
@@ -107,15 +107,15 @@
 		}
 	      
-	      vhdl.set_body ("access_next_entry_"+toString(i)+"("+toString(k)+") <=");
-	      vhdl.set_body ("\tnot access_entity_"+toString(i)+"("+toString(j)+") "+cond);
+	      vhdl->set_body ("access_next_entry_"+toString(i)+"("+toString(k)+") <=");
+	      vhdl->set_body ("\tnot access_entity_"+toString(i)+"("+toString(j)+") "+cond);
 	      if (have_cond == true)
-		vhdl.set_body ("\telse access_entry_"+toString(i)+"("+toString(k)+")");
-	      vhdl.set_body ("\t;");	      
+		vhdl->set_body ("\telse access_entry_"+toString(i)+"("+toString(k)+")");
+	      vhdl->set_body ("\t;");	      
 	      cpt ++;
 	    }
 	}
 
-    vhdl.set_body ("");
-    vhdl.set_body ("-- port update");
+    vhdl->set_body ("");
+    vhdl->set_body ("-- port update");
     for (uint32_t i=0; i<_param._nb_update; i++)
       for (int32_t j=static_cast<uint32_t>(log2(_param._nb_entity)-1); j>=0; j--)
@@ -137,9 +137,9 @@
 		  else
 		    cond += " and";
-		  cond += " in_UPDATE_ENTITY_"+toString(i)+"("+toString(l)+")='"+toString((cpt>>(l-(j+1)))&1)+"'";
+		  cond += " in_UPDATE_"+toString(i)+"_ENTITY("+toString(l)+")='"+toString((cpt>>(l-(j+1)))&1)+"'";
 		}
 	      
-	      vhdl.set_body ("update_next_entry_"+toString(i)+"("+toString(k)+") <=");
-	      vhdl.set_body ("\tnot in_UPDATE_ENTITY_"+toString(i)+"("+toString(j)+") "+cond);
+	      vhdl->set_body ("update_next_entry_"+toString(i)+"("+toString(k)+") <=");
+	      vhdl->set_body ("\tnot in_UPDATE_"+toString(i)+"_ENTITY("+toString(j)+") "+cond);
 	      if (have_cond == true)
 		{
@@ -147,25 +147,25 @@
 
 		  if (_param._size_table>1)
-		    update_address = "conv_integer(in_UPDATE_ADDRESS_"+toString(i)+")";
+		    update_address = "conv_integer(in_UPDATE_"+toString(i)+"_ADDRESS)";
 		  else
 		    update_address = "0";
 		  
-		  vhdl.set_body ("\telse reg_TABLE ("+update_address+")("+toString(k)+")");
+		  vhdl->set_body ("\telse reg_TABLE ("+update_address+")("+toString(k)+")");
 		}
-	      vhdl.set_body ("\t;");	      
+	      vhdl->set_body ("\t;");	      
 	      cpt ++;
 	    }
 	}
 
-    vhdl.set_body ("");
-    vhdl.set_body ("-----------------------------------------------------------------------------");
-    vhdl.set_body ("-- Transition");
-    vhdl.set_body ("-----------------------------------------------------------------------------");
-    vhdl.set_body ("");
-
-    vhdl.set_body ("reg_TABLE_write: process (in_CLOCK)");
-    vhdl.set_body ("begin");
-    vhdl.set_body ("\tif in_CLOCK'event and in_CLOCK = '1' then");
-    vhdl.set_body ("\t\t-- Access port");
+    vhdl->set_body ("");
+    vhdl->set_body ("-----------------------------------------------------------------------------");
+    vhdl->set_body ("-- Transition");
+    vhdl->set_body ("-----------------------------------------------------------------------------");
+    vhdl->set_body ("");
+
+    vhdl->set_body ("reg_TABLE_write: process (in_CLOCK)");
+    vhdl->set_body ("begin");
+    vhdl->set_body ("\tif in_CLOCK'event and in_CLOCK = '1' then");
+    vhdl->set_body ("\t\t-- Access port");
     for (uint32_t i=0; i<_param._nb_access; i++)
       {
@@ -173,14 +173,14 @@
 
 	if (_param._size_table>1)
-	  access_address = "conv_integer(in_ACCESS_ADDRESS_"+toString(i)+")";
+	  access_address = "conv_integer(in_ACCESS_"+toString(i)+"_ADDRESS)";
 	else
 	  access_address = "0";
 
-	vhdl.set_body ("\t\tif (in_ACCESS_VAL_"+toString(i)+" = '1') then");
-	vhdl.set_body ("\t\t\treg_TABLE ("+access_address+") <= access_next_entry_"+toString(i)+";");
-	vhdl.set_body ("\t\tend if;");
-      }
-
-    vhdl.set_body ("\t\t-- Update port");
+	vhdl->set_body ("\t\tif (in_ACCESS_"+toString(i)+"_VAL = '1') then");
+	vhdl->set_body ("\t\t\treg_TABLE ("+access_address+") <= access_next_entry_"+toString(i)+";");
+	vhdl->set_body ("\t\tend if;");
+      }
+
+    vhdl->set_body ("\t\t-- Update port");
     for (uint32_t i=0; i<_param._nb_update; i++)
       {
@@ -188,32 +188,32 @@
 
 	if (_param._size_table>1)
-	  update_address = "conv_integer(in_UPDATE_ADDRESS_"+toString(i)+")";
+	  update_address = "conv_integer(in_UPDATE_"+toString(i)+"_ADDRESS)";
 	else
 	  update_address = "0";
 		  
-	vhdl.set_body ("\t\tif (in_UPDATE_VAL_"+toString(i)+" = '1') then");
-	vhdl.set_body ("\t\t\treg_TABLE ("+update_address+") <= update_next_entry_"+toString(i)+";");
-	vhdl.set_body ("\t\tend if;");
-      }
-
-    vhdl.set_body ("\tend if;");
-    vhdl.set_body ("end process reg_TABLE_write;");
-
-    vhdl.set_body ("");
-    vhdl.set_body ("-----------------------------------------------------------------------------");
-    vhdl.set_body ("-- Output");
-    vhdl.set_body ("-----------------------------------------------------------------------------");
-    vhdl.set_body ("");
-    vhdl.set_body ("-- Ack is always ");
-    vhdl.set_body ("");
-    for (uint32_t i=0; i<_param._nb_access; i++)
-      {
-	vhdl.set_body ("out_ACCESS_ACK_"+toString(i)+"    <= '1';");
-	vhdl.set_body ("out_ACCESS_ENTITY_"+toString(i)+" <= access_entity_"+toString(i)+" when in_ACCESS_VAL_"+toString(i)+" = '1' else (others => '0');");
-      }
-    vhdl.set_body ("");
+	vhdl->set_body ("\t\tif (in_UPDATE_"+toString(i)+"_VAL = '1') then");
+	vhdl->set_body ("\t\t\treg_TABLE ("+update_address+") <= update_next_entry_"+toString(i)+";");
+	vhdl->set_body ("\t\tend if;");
+      }
+
+    vhdl->set_body ("\tend if;");
+    vhdl->set_body ("end process reg_TABLE_write;");
+
+    vhdl->set_body ("");
+    vhdl->set_body ("-----------------------------------------------------------------------------");
+    vhdl->set_body ("-- Output");
+    vhdl->set_body ("-----------------------------------------------------------------------------");
+    vhdl->set_body ("");
+    vhdl->set_body ("-- Ack is always ");
+    vhdl->set_body ("");
+    for (uint32_t i=0; i<_param._nb_access; i++)
+      {
+	vhdl->set_body ("out_ACCESS_"+toString(i)+"_ACK    <= '1';");
+	vhdl->set_body ("out_ACCESS_"+toString(i)+"_ENTITY <= access_entity_"+toString(i)+" when in_ACCESS_"+toString(i)+"_VAL = '1' else (others => '0');");
+      }
+    vhdl->set_body ("");
     for (uint32_t i=0; i<_param._nb_update; i++)
       {
-	vhdl.set_body ("out_UPDATE_ACK_"+toString(i)+"    <= '1';");
+	vhdl->set_body ("out_UPDATE_"+toString(i)+"_ACK    <= '1';");
       }
   };
