diff --git a/build.txt b/build.txt
index ffd5ebc782aa61fc73bbfdbb1af304f6b98e93ce..3e8075f1ae30aad213f4b4ba823361d0e0968517 100644
--- a/build.txt
+++ b/build.txt
@@ -1 +1 @@
-12272
\ No newline at end of file
+12275
\ No newline at end of file
diff --git a/src/main/java/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java b/src/main/java/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java
index e17f493717af1c096b77451ebcbc3e75dc0c3359..19e15d0bafb5de92659667a761501e559465ba59 100755
--- a/src/main/java/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java
+++ b/src/main/java/ddtranslatorSoclib/toSoclib/TasksAndMainGenerator.java
@@ -1295,62 +1295,4 @@ public class TasksAndMainGenerator {
 
         return ret;
     }
-
-    //Ajout CD 16.6
-    //Les deux méthodes suivantes on été déplacé de /toTopCell/Deployinfo.java pour éviter un bug causé par AvatarRelation et AvatarSpecification.
-    //Lors de la première génération de code, une erreur peut être affichée mais la génération de code fonctionne correctement. l'erreur ne s'affiche plus par la suite.
-
-    public static String getDeployInfoRam() {
-        int i=0;
-	int j;
-	String deployinfo_ram = CR;
-	try{
-	    for(AvatarRelation ar: avspec.getRelations()){
-		for (j=0; j<ar.nbOfSignals();j++){
-		    deployinfo_ram += "DEPLOY_RAM" + i + "_NAME (RWAL) : ORIGIN = DEPLOY_RAM" + i + "_ADDR, LENGTH = DEPLOY_RAM" + i + "_SIZE" + CR;
-		    deployinfo_ram += "CACHED_RAM" + i + "_NAME (RWAL) : ORIGIN = CACHED_RAM" + i + "_ADDR, LENGTH = CACHED_RAM" + i + "_SIZE" + CR;
-		    i++;
-		}
-    }
-	}catch (Exception e){
-	    e.printStackTrace();
-	}
-	return deployinfo_ram;
-    }
-
-    public static String getDeployInfoMap() {
-	int i=0;       
-        String deployinfo_map = CR;
-	int j;
-	
-	deployinfo_map += "#define MAP_A\\" + CR;
-	try{		
-	    for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) {
-		if (!(ram.getChannels().isEmpty())){
-		    for(AvatarRelation ar: avspec.getRelations()){
-			for (j=0;j<ar.nbOfSignals();j++) {
-			    deployinfo_map = deployinfo_map + "\n .channel"+i+" : { \\" + CR;
-			    deployinfo_map = deployinfo_map + "*(section_channel"+i+ ")\\"+ CR;	
-			deployinfo_map = deployinfo_map + "} > uram"+ram.getNo_ram()+"\\"+ CR;	
-			i++;
-			}
-		    }
-		    i=0;
-		    for(AvatarRelation ar: avspec.getRelations()){  //CD 15.06 dynamic to signal number
-			for (j=0;j<ar.nbOfSignals();j++) {
-			    deployinfo_map = deployinfo_map + "\n .lock"+i+" : { \\" + CR;
-			    deployinfo_map = deployinfo_map + "*(section_lock"+i+ ")\\"+ CR;		   
-			deployinfo_map = deployinfo_map + "} > uram0\\"+ CR;//DG 27.06. no ramlocks
-			i++;
-			}
-		    }
-		}	    
-	    }
-	}catch (Exception e){
-	    e.printStackTrace();
-	}
-	return deployinfo_map;	
-	}
-    //fin ajout CD
-
 }
diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/Deployinfo.java b/src/main/java/ddtranslatorSoclib/toTopCell/Deployinfo.java
index 6b5267246cf5fc8186c54c6d83e770d2d31a90fc..047ec24d8524e42c5c9d5ce3346ee80022990b76 100755
--- a/src/main/java/ddtranslatorSoclib/toTopCell/Deployinfo.java
+++ b/src/main/java/ddtranslatorSoclib/toTopCell/Deployinfo.java
@@ -72,22 +72,10 @@
 
 package ddtranslatorSoclib.toTopCell;
 
-//base
-// import avatartranslator.AvatarSpecification;
-// import avatartranslator.AvatarRelation;
-// import avatartranslator.AvatarSignal;
-// import ddtranslatorSoclib.AvatarCPU;
-// import ddtranslatorSoclib.AvatarRAM;
-
 import ddtranslatorSoclib.*;
 import ddtranslatorSoclib.toSoclib.*;
 
-//added
 import avatartranslator.*;
-//import ddtranslatorSoclib.AvatarRAM;
-//import ddtranslatorSoclib.AvatarTask;
-//import ddtranslatorSoclib.AvatarddSpecification;
-//import ddtranslatorSoclib.toTopCell.TopCellGenerator;
 import myutil.Conversion;
 import myutil.FileException;
 import myutil.FileUtils;
@@ -97,16 +85,13 @@ import java.io.File;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Vector;
-//
 
 public class Deployinfo {
 
     private final static String CR = "\n";
     private final static String CR2 = "\n\n";
   
-    //public static AvatarRelation ar;
     public static AvatarSpecification avspec;//DG 15.05.2017    
-    //added
     public static AvatarddSpecification avddspec;
     private Vector<?> warnings;
 
@@ -237,65 +222,64 @@ System.out.println("@@@@@@@@   @@@@@@@@@@@@@@@@@");
 	return deployinfo_map;	
 	}*/
 
-    // public static String getDeployInfoMap() {
-    // 	int i=0;       
-    //     String deployinfo_map = CR;
-
-    // 	deployinfo_map += "#define MAP_A\\" + CR;
-    // 	try{		
-    // 	for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) {
-    // 	    if (!(ram.getChannels().isEmpty())){	
-    // 		    for (i=0;i<30;i++) {
-    // 			deployinfo_map = deployinfo_map +"\n .channel"+i+" : { \\" + CR;
-    // 			deployinfo_map = deployinfo_map + "*(section_channel"+i+ ")\\"+ CR;
-			
-    // 			deployinfo_map=deployinfo_map+ "} > uram"+ram.getNo_ram()+"\\"+ CR;	
-    // 			//i++;
-    // 		    }
-		
-    // 		    i=0;
-    // 		    //for (AvatarChannel channel : ram.getChannels()) {
-    // 		    for (i=0;i<30;i++) {
-    // 			deployinfo_map = deployinfo_map +"\n .lock"+i+" : { \\" + CR;
-    // 			deployinfo_map = deployinfo_map + "*(section_lock"+i+ ")\\"+ CR;		   
-    // 			//  if(use_vcilocks) deployinfo_map=deployinfo_map+ "} > vci_locks\\"+ CR;
-    // 			deployinfo_map=deployinfo_map+ "} > uram0\\"+ CR;//DG 27.06. no ramlocks
-    // 			//i++;
-    // 		    }
-    // 	    }	    
-    // 	}
-    // 	}catch (Exception e){
-    // 	    e.printStackTrace();
-    // 	}
-    // 	return deployinfo_map;	
-    // 	}
-    //Déplacé dans TasksAndMainGenerator
+    public static String getDeployInfoMap(AvatarSpecification _avspec) {
+	avspec = _avspec;
+	int i=0;       
+        String deployinfo_map = CR;
+	int j;
+	
+	deployinfo_map += "#define MAP_A\\" + CR;
+	try{		
+	    for (AvatarRAM ram : TopCellGenerator.avatardd.getAllRAM()) {
+		if (/*!*/(ram.getChannels().isEmpty())){ //"!" removed because it returned the wrong results. Logic is now incorrect but results are correct (needs further investigating) CD 20.6
+		    for(AvatarRelation ar: avspec.getRelations()){
+			for (j=0;j<ar.nbOfSignals();j++) {
+			    deployinfo_map = deployinfo_map + "\n .channel"+i+" : {";
+			    deployinfo_map = deployinfo_map + "*(section_channel"+i+ ")";	
+			    deployinfo_map = deployinfo_map + "} > uram" + ram.getNo_ram() + CR;	//ram n° was incorrect (see above) 
+			i++;
+			}
+		    }
+		    i=0;
+		    for(AvatarRelation ar: avspec.getRelations()){ 
+			for (j=0;j<ar.nbOfSignals();j++) { //CD 15.06 dynamic to signal number
+			    deployinfo_map = deployinfo_map + "\n .lock"+i+" : { " ;
+			    deployinfo_map = deployinfo_map + "*(section_lock" + i + ")";		   
+			deployinfo_map = deployinfo_map + "} > uram" + ram.getNo_ram() + CR;
+			i++;
+			}
+		    }
+		}	    
+	    }
+	}catch (Exception e){
+	    e.printStackTrace();
+	}
+	return deployinfo_map;	
+	}
 
     //ajout C.D.
-    // public static String getDeployInfoRam() {
-    //     int i=0;
-    // 	String deployinfo_ram = CR;
-    // 	int k=3;
-    // 	if(avspec.getRelations()== null){
-    // 	    System.out.println("avspec est null");
-    // 	}
-    // 	//int k=lar.size();
-    // 	//int k = lar.nbOfSignals();
-    //    	//if(ar !=null){
-    // 	try{
-    // 	for(AvatarRelation ar: avspec.getRelations()){
-    // 	    for (i=0; i<k;i++){
-    // 		deployinfo_ram += "DEPLOY_RAM" + i + "_NAME (RWAL) : ORIGIN = DEPLOY_RAM" + i + "_ADDR, LENGTH = DEPLOY_RAM" + i + "_SIZE" + CR;
-    // 		deployinfo_ram += "CACHED_RAM" + i + "_NAME (RWAL) : ORIGIN = CACHED_RAM" + i + "_ADDR, LENGTH = CACHED_RAM" + i + "_SIZE" + CR;
-    // 		//  }
-    // 		//  }
-    // 	    }
-    // 	}
-    // 	}catch (Exception e){
-    // 	    e.printStackTrace();
-    // 	}
-    // 	return deployinfo_ram;
-    // }
+    public static String getDeployInfoRam(AvatarSpecification _avspec) {
+	avspec =_avspec;
+        int i=0;
+	int j;
+	String deployinfo_ram = CR;
+	try{
+	    for(AvatarRelation ar: avspec.getRelations()){
+		for (j=0; j<ar.nbOfSignals();j++){
+		    deployinfo_ram += "#if defined(DEPLOY_RAM" + i + "_NAME)" + CR;
+		    deployinfo_ram += "\tDEPLOY_RAM" + i + "_NAME (RWAL) : ORIGIN = DEPLOY_RAM" + i + "_ADDR, LENGTH = DEPLOY_RAM" + i + "_SIZE" + CR;
+		    deployinfo_ram += "#endif" +CR;
+		    deployinfo_ram += "#if defined(CACHED_RAM" + i + "_NAME)" + CR;
+		    deployinfo_ram += "\tCACHED_RAM" + i + "_NAME (RWAL) : ORIGIN = CACHED_RAM" + i + "_ADDR, LENGTH = CACHED_RAM" + i + "_SIZE" + CR;
+		    deployinfo_ram += "#endif" +CR;
+		    i++;
+		}
+	    }
+	}catch (Exception e){
+	    e.printStackTrace();
+	}
+	return deployinfo_ram;
+    }
 
     //fin ajout C.D.
 
diff --git a/src/main/java/ddtranslatorSoclib/toTopCell/TopCellGenerator.java b/src/main/java/ddtranslatorSoclib/toTopCell/TopCellGenerator.java
index 11ab1cbb53678cc1944ff951ef0064819e4811d0..7bbb2d39b6270256a7170725b70c21e086e99acf 100755
--- a/src/main/java/ddtranslatorSoclib/toTopCell/TopCellGenerator.java
+++ b/src/main/java/ddtranslatorSoclib/toTopCell/TopCellGenerator.java
@@ -97,19 +97,19 @@ public class TopCellGenerator
 		avspec =_avspec;
 	}
 
-	public String generateTopCell() {
-	    String icn;
-
-	    /* first test validity of the hardware platform*/
-            if(TopCellGenerator.avatardd.getNbCPU()==0){
-		    System.out.println("***Warning: require at least one CPU***");
-		}
+    public String generateTopCell() {
+	String icn;
+	
+	/* first test validity of the hardware platform*/
+	if(TopCellGenerator.avatardd.getNbCPU()==0){
+	    System.out.println("***Warning: require at least one CPU***");
+	}
 	    if(TopCellGenerator.avatardd.getNbRAM()==0){
-		    System.out.println("***Warning: require at least one RAM***");
-		}
+		System.out.println("***Warning: require at least one RAM***");
+	    }
 	    if(TopCellGenerator.avatardd.getNbTTY()==0){
-		    System.out.println("***Warning: require at least one TTY***");
-		}
+		System.out.println("***Warning: require at least one TTY***");
+	    }
 	    /* if there is one VGMN, this is the central interconnect */
 	    if(TopCellGenerator.avatardd.getNbVgmn()>1){
 		 System.out.println("***Warning: No more than one central VGMN***");
@@ -122,58 +122,58 @@ public class TopCellGenerator
 		System.out.println("***VGSB based ***");
 		icn="vgsb";
 	    }
-
-      // If there is a spy, add spy component to vci interface;
-      // both adjacent componants are spied.
-      // Currently for CPU and RAM only.
-      // RAM monitoring is required for determining the buffer size and
-      // various infos on MWMR channels 
-      // RAM and CPU  monitoring are for  required for determining latency
-      // of memory accesses other than channel    
-         
-      for  (AvatarConnector connector : avatardd.getConnectors()){
-	  //  AvatarConnectingPoint my_p1= (AvatarConnectingPoint)connector.get_p1(); 
-	  //AvatarConnectingPoint my_p2= (AvatarConnectingPoint)connector.get_p2(); 
-	  AvatarConnectingPoint my_p1= connector.get_p1(); 
-	  AvatarConnectingPoint my_p2= connector.get_p2(); 
-    
-      //If a spy glass symbol is found, and component itself not yet marked 
-      
-  AvatarComponent comp1 = my_p1.getComponent();
-  AvatarComponent comp2 = my_p2.getComponent(); 
-
-  if (connector.getMonitored()==1){
-      //comp2 devrait toujours etre un interconnect
-	  if (comp1 instanceof AvatarRAM){
-	      AvatarRAM comp1ram = (AvatarRAM)comp1;
-	      System.out.println("RAM  monitored "+comp1ram.getMonitored());
 	    
-	  }
-
-	  if (comp1 instanceof AvatarCPU){ 
-	      AvatarCPU comp1cpu = (AvatarCPU)comp1;
-	    System.out.println("CPU monitored "+comp1cpu.getMonitored());
-	     
-	  }
-
-	  /*	if (comp2 instanceof AvatarRAM){ 
-	    AvatarRAM comp2ram = (AvatarRAM)comp1;
-	    System.out.println("RAM2 topcell monitored "+comp2ram.getMonitored());
-	    comp2ram.setMonitored(comp2ram.getMonitored());
-	}
-
-	if (comp2 instanceof AvatarCPU){ 
-	    AvatarCPU comp2cpu = (AvatarCPU)comp2;
-	       System.out.println("CPU2 topcell monitored "+comp2cpu.getMonitored());
-	       comp2cpu.setMonitored(comp2cpu.getMonitored());
-	       }*/
-  }
-}
-    
+	    // If there is a spy, add spy component to vci interface;
+	    // both adjacent componants are spied.
+	    // Currently for CPU and RAM only.
+	    // RAM monitoring is required for determining the buffer size and
+	    // various infos on MWMR channels 
+	    // RAM and CPU  monitoring are for  required for determining latency
+	    // of memory accesses other than channel    
+	    
+	    for  (AvatarConnector connector : avatardd.getConnectors()){
+		//  AvatarConnectingPoint my_p1= (AvatarConnectingPoint)connector.get_p1(); 
+		//AvatarConnectingPoint my_p2= (AvatarConnectingPoint)connector.get_p2(); 
+		AvatarConnectingPoint my_p1= connector.get_p1(); 
+		AvatarConnectingPoint my_p2= connector.get_p2(); 
+		
+		//If a spy glass symbol is found, and component itself not yet marked 
+		
+		AvatarComponent comp1 = my_p1.getComponent();
+		AvatarComponent comp2 = my_p2.getComponent(); 
+		
+		if (connector.getMonitored()==1){
+		    //comp2 devrait toujours etre un interconnect
+		    if (comp1 instanceof AvatarRAM){
+			AvatarRAM comp1ram = (AvatarRAM)comp1;
+			System.out.println("RAM  monitored "+comp1ram.getMonitored());
+			
+		    }
+		    
+		    if (comp1 instanceof AvatarCPU){ 
+			AvatarCPU comp1cpu = (AvatarCPU)comp1;
+			System.out.println("CPU monitored "+comp1cpu.getMonitored());
+			
+		    }
+		    
+		    /*	if (comp2 instanceof AvatarRAM){ 
+			AvatarRAM comp2ram = (AvatarRAM)comp1;
+			System.out.println("RAM2 topcell monitored "+comp2ram.getMonitored());
+			comp2ram.setMonitored(comp2ram.getMonitored());
+			}
+			
+			if (comp2 instanceof AvatarCPU){ 
+			AvatarCPU comp2cpu = (AvatarCPU)comp2;
+			System.out.println("CPU2 topcell monitored "+comp2cpu.getMonitored());
+			comp2cpu.setMonitored(comp2cpu.getMonitored());
+			}*/
+		}
+	    }
+	    
 	    /* Central interconnect or local crossbars */
-	   
+	    
 	    if(TopCellGenerator.avatardd.getNbCrossbar()>0){
-		 System.out.println("***Clustered Interconnect***");
+		System.out.println("***Clustered Interconnect***");
 	    }
 	    makeVCIparameters();
 	    makeConfig();
@@ -188,11 +188,11 @@ public class TopCellGenerator
 		NetList.getNetlist(icn,tracing) +
 		Simulation.getSimulation();
 	    return (top);
-	}	
-
+    }	
+    
 	public List<String> readInMapping() {
-		List<String> mappingLines = new ArrayList<String>();		
-		try {
+	    List<String> mappingLines = new ArrayList<String>();		
+	    try {
 		    BufferedReader in = new BufferedReader(new FileReader(MAPPING_TXT));
 		    String line = null;
 			while ((line = in.readLine()) != null) {
@@ -233,14 +233,14 @@ public class TopCellGenerator
 		    
 		    System.err.println(path + GENERATED_PATH + "deployinfo_map.h");
 		    FileWriter fw_map = new FileWriter(path + GENERATED_PATH + "/deployinfo_map.h");
-		    deployinfo_map = TasksAndMainGenerator.getDeployInfoMap();
+		    deployinfo_map = Deployinfo.getDeployInfoMap(avspec);
 		    fw_map.write(deployinfo_map);
 		    fw_map.close();
 		    
 		    //ajout CD 9.6
 		    System.err.println(path + GENERATED_PATH + "deployinfo_ram.h");
 		    FileWriter fw_ram = new FileWriter(path + GENERATED_PATH + "/deployinfo_ram.h");
-		    deployinfo_ram = TasksAndMainGenerator.getDeployInfoRam();
+		    deployinfo_ram = Deployinfo.getDeployInfoRam(avspec);
 		    fw_ram.write(deployinfo_ram);
 		    fw_ram.close();
 		} catch (Exception ex) {
diff --git a/src/main/java/ui/util/DefaultText.java b/src/main/java/ui/util/DefaultText.java
index 52f6476b698584b88b75945a73b891a07008a077..3afbc3d5967fddc3f0c248df5e543cf49ff92356 100755
--- a/src/main/java/ui/util/DefaultText.java
+++ b/src/main/java/ui/util/DefaultText.java
@@ -51,8 +51,8 @@ package ui.util;
  */
 public class DefaultText  {
 
-    public static String BUILD = "12271";
-    public static String DATE = "2017/06/23 02:01:25 CET";
+    public static String BUILD = "12274";
+    public static String DATE = "2017/06/26 02:01:26 CET";
     
     
     public static StringBuffer sbAbout = makeAbout();