From 6d1f89422c4f6a8902367a13fe9430b82a2a60eb Mon Sep 17 00:00:00 2001
From: Daniela Genius <genius@debussy.soc.lip6.fr>
Date: Thu, 19 Sep 2019 16:05:04 +0200
Subject: [PATCH] modified cluster code generation for stand-alone version

---
 .../toSysCAMS/ClusterCode.java                | 193 ++++++++++++++++--
 .../syscamstranslator/toSysCAMS/Header.java   |   4 +-
 .../toSysCAMS/PrimitiveCode.java              |   8 +-
 .../toSysCAMSCluster/HeaderCluster.java       |   4 +-
 .../PrimitiveCodeCluster.java                 |   6 +-
 .../toSysCAMSSoclib/HeaderSoclib.java         |   4 +-
 ...DialogSysCAMSExecutableCodeGeneration.java |  12 +-
 .../window/JDialogSysCAMSPortConverter.java   |  10 +-
 .../java/ui/window/JDialogSysCAMSPortDE.java  |  10 +-
 9 files changed, 211 insertions(+), 40 deletions(-)

diff --git a/src/main/java/syscamstranslator/toSysCAMS/ClusterCode.java b/src/main/java/syscamstranslator/toSysCAMS/ClusterCode.java
index 892641f459..cf3aa9237c 100644
--- a/src/main/java/syscamstranslator/toSysCAMS/ClusterCode.java
+++ b/src/main/java/syscamstranslator/toSysCAMS/ClusterCode.java
@@ -74,8 +74,12 @@ public class ClusterCode {
 	    LinkedList<SysCAMSTBlockTDF> tdf = cluster.getBlockTDF();
 	    LinkedList<SysCAMSTBlockDE> de = cluster.getBlockDE();
 	    LinkedList<SysCAMSTClock> clock = cluster.getClock();
-			
 
+	    //DG 19.09.
+	    //corpsCluster = "template <typename vci_param>" + CR +
+		//     "class " +cluster.getClusterName()+ " : public sc_core::sc_module { "+ CR;
+           //fin DG 19.09.
+	    
 	    corpsCluster = "// Simulation entry point." + CR + "int sc_main(int argc, char *argv[]) {" + CR2 
 		+ "\tusing namespace sc_core;" + CR + "\tusing namespace sca_util;" + CR2;
 
@@ -84,32 +88,33 @@ public class ClusterCode {
 	    for (SysCAMSTConnector c : connectors) {
 		if ((c.get_p1().getComponent() instanceof SysCAMSTPortTDF && c.get_p2().getComponent() instanceof SysCAMSTPortTDF) 
 		    || (c.get_p1().getComponent() instanceof SysCAMSTPortTDF && c.get_p2().getComponent() instanceof SysCAMSTPortTDF)) {
-		    if (c.getName().equals("")) {
+		    if (c.getName().equals("")) {//corpsCluster +="6"+CR;
 			corpsCluster = corpsCluster + "\tsca_tdf::sca_signal<" + ((SysCAMSTPortTDF) c.get_p1().getComponent()).getTDFType() + " > " 
 			    + "sig_" + nb_con + ";" + CR;
 			names.add("sig_" + nb_con);
 			nb_con++;
-		    } else {
+		    } else {//corpsCluster +="5"+CR;
 			corpsCluster = corpsCluster + "\tsca_tdf::sca_signal<" + ((SysCAMSTPortTDF) c.get_p1().getComponent()).getTDFType() + "> " 
 			    + c.getName() + ";" + CR;
 			names.add(c.getName());
 		    }
 		} else if ((c.get_p1().getComponent() instanceof SysCAMSTPortConverter && c.get_p2().getComponent() instanceof SysCAMSTPortDE)) {
-		    if (c.getName().equals("")) {
-			corpsCluster = corpsCluster + "\tsca_tdf::sca_signal<" + ((SysCAMSTPortConverter) c.get_p1().getComponent()).getConvType() + "> " 
-			    + "sig_" + nb_con + ";" + CR;
+		if (c.getName().equals("")) {// corpsCluster +="4"+CR;
+		    //		corpsCluster = corpsCluster + "\tsca_tdf::sca_signal<" + ((SysCAMSTPortConverter) c.get_p1().getComponent()).getConvType() + "> "  + "sig_" + nb_con + ";" + CR;//DG 19.09 sca-> sc
+		   
+		    		corpsCluster = corpsCluster + "\tsc_core::sc_signal<" + ((SysCAMSTPortConverter) c.get_p1().getComponent()).getConvType() + "> "  + "sig_" + nb_con + ";" + CR;//DG 19.09 sca-> sc
 			names.add("sig_" + nb_con);
 			nb_con++;
-		    } else{
-
-				if(((SysCAMSTPortConverter) c.get_p1().getComponent()).getNbits()==0)
-				    {
-				corpsCluster = corpsCluster + "\tsca_tdf::sca_signal<" + ((SysCAMSTPortConverter) c.get_p1().getComponent()).getConvType() + "> " 
-				    + c.getName() + ";" + CR;
+		} else{
+		   if(((SysCAMSTPortConverter) c.get_p1().getComponent()).getNbits()==0)
+		       { //corpsCluster +="3"+CR;
+					//	corpsCluster = corpsCluster + "\tsca_tdf::sca_signal<" + ((SysCAMSTPortConverter) c.get_p1().getComponent()).getConvType() + "> " + c.getName() + ";" + CR;//DG 19.09 sca-> sc
+			       corpsCluster = corpsCluster + "\tsc_core::sc_signal<" + ((SysCAMSTPortConverter) c.get_p1().getComponent()).getConvType() + "> " + c.getName() + ";" + CR;//DG 19.09 sca-> sc	
 				names.add(c.getName());
 				    }
 
 					else{//sc_uint
+					     //corpsCluster +="2"+CR;
 			    corpsCluster = corpsCluster + "\tsca_tdf::sca_signal<" + ((SysCAMSTPortConverter) c.get_p1().getComponent()).getConvType()+ "<"+ ((SysCAMSTPortConverter) c.get_p1().getComponent()).getNbits()+"> " + "> " 
 				+ c.getName() + ";" + CR;
 			    names.add(c.getName());
@@ -119,7 +124,7 @@ public class ClusterCode {
 		    
 			        }			
 		    } else if ((c.get_p2().getComponent() instanceof SysCAMSTPortConverter && c.get_p1().getComponent() instanceof SysCAMSTPortDE)) {
-		    if (c.getName().equals("")) {
+		if (c.getName().equals("")) {// corpsCluster +="0"+CR;
 			corpsCluster = corpsCluster + "\tsca_tdf::sca_signal<" + ((SysCAMSTPortConverter) c.get_p2().getComponent()).getConvType() + " > " 
 			    + "sig_" + nb_con + ";" + CR;
 			names.add("sig_" + nb_con);
@@ -133,6 +138,7 @@ public class ClusterCode {
 			    }
 
 		    	else{//sc_uint
+			    //corpsCluster +="1"+CR;
 			    corpsCluster = corpsCluster + "\tsca_tdf::sca_signal<" + ((SysCAMSTPortConverter) c.get_p2().getComponent()).getConvType()+ "<"+((SysCAMSTPortConverter) c.get_p2().getComponent()).getNbits() + "> > " 
 				+ c.getName() + ";" + CR;
 			    names.add(c.getName());
@@ -172,7 +178,8 @@ public class ClusterCode {
 		    corpsCluster = corpsCluster + "\t  sc_clock " + t.getName() + " (\"" + t.getName() + "\"," + t.getFrequency()+","+ t.getUnit()+","+ t.getDutyCycle()+","+ t.getStartTime()+","+ t.getUnitStartTime()+","+ t.getPosFirst()+");" + CR;
 		}
 					
-		corpsCluster = corpsCluster + CR + "\t// Instantiate headers files as well as bind their ports to the signal." + CR;
+		/* DG 19.09.
+		    corpsCluster = corpsCluster + CR + "\t// Instantiate headers files as well as bind their ports to the signal." + CR;
 			
 			
 		for (SysCAMSTBlockTDF t : tdf) {
@@ -246,6 +253,164 @@ public class ClusterCode {
 		    nb_block++;
 		}			
 
+		*/
+		
+//fin DG 19.09.
+		
+//DG 19.09. replaced by new code from Rodrigo's version
+		nb_block=0;//DG 19.09. corrected reset to 0
+				corpsCluster = corpsCluster + CR + "\t// Instantiate cluster's modules." + CR;
+		// DG 19.09. enleve		
+				/*    for (SysCAMSTBlockTDF t : tdf) {
+                corpsCluster = corpsCluster + "\t" + t.getName();
+                if (!t.getListTypedef().isEmpty()) {
+                    corpsCluster += "<"+t.getValueTemplate()+">";
+                }
+                corpsCluster += " " + t.getName() + "_" + nb_block + ";" + CR;
+                nb_block++;
+            }
+            
+            for (SysCAMSTBlockDE t : de) {
+                corpsCluster = corpsCluster + "\t" + t.getName();
+                if (!t.getListTypedef().isEmpty()) {
+                    corpsCluster += "<"+t.getValueTemplate()+">";
+                }
+                corpsCluster += " " + t.getName() + "_" + nb_block + ";" + CR;
+                nb_block++;
+		}*/
+            // DG 19.09. enleve
+            //corpsCluster = corpsCluster + "public:" + CR;
+        
+	    //   corpsCluster = corpsCluster + "\tsc_in< typename vci_param::data_t > in_ams;" + CR;
+            //corpsCluster = corpsCluster + "\tsc_out< typename vci_param::data_t > out_ams;" + CR2;
+            
+            nb_block = 0;
+            //corpsCluster = corpsCluster + "\tSC_CTOR(" +cluster.getClusterName()+ ") :" + CR;
+            for (SysCAMSTBlockTDF t : tdf) {
+                corpsCluster = corpsCluster + "\t" + t.getName()+ " " + t.getName() + "_" + nb_block + "(\"" + t.getName() + "_" + nb_block + "\");" + CR;
+                nb_block++;
+            }
+            for (SysCAMSTBlockDE t : de) {
+                corpsCluster = corpsCluster + "\t" + t.getName()+ " " + t.getName() + "_" + nb_block + "(\"" + t.getName() + "_" + nb_block + "\");" + CR;
+                nb_block++;
+            }
+	    //DG 19.09. enleve
+	    // corpsCluster = corpsCluster + "\tin_ams(\"in_ams\")," + CR;
+            //corpsCluster = corpsCluster + "\tout_ams(\"out_ams\") {" + CR;
+            
+            nb_block = 0;
+			for (SysCAMSTBlockTDF t : tdf) {
+				//corpsCluster = corpsCluster + "\t" + t.getName() + " " + t.getName() + "_" + nb_block + "(\"" + t.getName() + "_" + nb_block + "\");" + CR;
+				
+				LinkedList<SysCAMSTPortTDF> portTDF = t.getPortTDF();
+				LinkedList<SysCAMSTPortConverter> portConv = t.getPortConverter();
+			
+				for (SysCAMSTPortTDF p : portTDF) {
+					for (int i = 0; i < connectors.size(); i++) {
+						if (connectors.get(i).get_p1().getComponent() instanceof SysCAMSTPortTDF && connectors.get(i).get_p2().getComponent() instanceof SysCAMSTPortTDF) {
+                            if (((SysCAMSTPortTDF) connectors.get(i).get_p1().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortTDF) connectors.get(i).get_p1().getComponent()).getBlockTDF().getName().equals(t.getName())) {
+                                corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(" + names.get(i) + ");" + CR;
+                            } else if (((SysCAMSTPortTDF) connectors.get(i).get_p2().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortTDF) connectors.get(i).get_p2().getComponent()).getBlockTDF().getName().equals(t.getName())) {
+                                corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(" + names.get(i) + ");" + CR;
+                            }
+                        } 
+					}
+				}
+					
+				for (SysCAMSTPortConverter p : portConv) {
+					for (int i = 0; i < connectors.size(); i++) {
+                        nb_con = i;
+                        
+                        if ( !((connectors.get(i).get_p1().getComponent() instanceof SysCAMSTPortDE && ((SysCAMSTPortDE) connectors.get(i).get_p1().getComponent()).getBlockGPIO2VCI() != null) 
+                        || (connectors.get(i).get_p2().getComponent() instanceof SysCAMSTPortDE && ((SysCAMSTPortDE) connectors.get(i).get_p2().getComponent()).getBlockGPIO2VCI() != null)) ) {
+                            if (connectors.get(i).get_p1().getComponent() instanceof SysCAMSTPortConverter && connectors.get(i).get_p2().getComponent() instanceof SysCAMSTPortDE) {
+                                if (((SysCAMSTPortConverter) connectors.get(i).get_p1().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortConverter) connectors.get(i).get_p1().getComponent()).getBlockTDF().getName().equals(t.getName())) {
+                                    corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(" + names.get(i) + ");" + CR;
+                                } else if (((SysCAMSTPortDE) connectors.get(i).get_p2().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortDE) connectors.get(i).get_p2().getComponent()).getBlockDE().getName().equals(t.getName())) {
+                                    corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(" + names.get(i) + ");" + CR;
+                                }
+                            } else if (connectors.get(i).get_p2().getComponent() instanceof SysCAMSTPortConverter && connectors.get(i).get_p1().getComponent() instanceof SysCAMSTPortDE) {
+                                if (((SysCAMSTPortConverter) connectors.get(i).get_p2().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortConverter) connectors.get(i).get_p2().getComponent()).getBlockTDF().getName().equals(t.getName())) {
+                                    corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(" + names.get(i) + ");" + CR;
+                                } else if (((SysCAMSTPortDE) connectors.get(i).get_p1().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortDE) connectors.get(i).get_p1().getComponent()).getBlockDE().getName().equals(t.getName())) {
+                                    corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(" + names.get(i) + ");" + CR;
+                                }
+                            }
+                        } else {
+                            if (connectors.get(i).get_p1().getComponent() instanceof SysCAMSTPortDE && ((SysCAMSTPortDE) connectors.get(i).get_p1().getComponent()).getBlockGPIO2VCI() != null) {
+                                if (connectors.get(i).get_p2().getComponent() instanceof SysCAMSTPortConverter) {
+                                    if (((SysCAMSTPortConverter) connectors.get(i).get_p2().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortConverter) connectors.get(i).get_p2().getComponent()).getBlockTDF().getName().equals(t.getName())) {
+                                        corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(in_ams);" + CR;                                    
+                                    }
+                                }
+                            } else if (connectors.get(i).get_p2().getComponent() instanceof SysCAMSTPortDE && ((SysCAMSTPortDE) connectors.get(i).get_p2().getComponent()).getBlockGPIO2VCI() != null) {
+                                if (connectors.get(i).get_p1().getComponent() instanceof SysCAMSTPortConverter) {
+                                    if (((SysCAMSTPortConverter) connectors.get(i).get_p1().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortConverter) connectors.get(i).get_p1().getComponent()).getBlockTDF().getName().equals(t.getName())) {
+                                        corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(out_ams);" + CR;                                    
+                                    }
+                                }
+                            }
+                        } 
+                    }
+				}
+				corpsCluster = corpsCluster + CR;
+				nb_block++;
+			}
+			
+			for (SysCAMSTBlockDE t : de) {
+				//corpsCluster = corpsCluster + "\t" + t.getName() + " " + t.getName() + "_" + nb_block + "(\"" + t.getName() + "_" + nb_block + "\");" + CR;
+				
+				LinkedList<SysCAMSTPortDE> portDE = t.getPortDE();
+			
+				for (SysCAMSTPortDE p : portDE) {
+					for (int i = 0; i < connectors.size(); i++) {
+                        if ( !((connectors.get(i).get_p1().getComponent() instanceof SysCAMSTPortDE && ((SysCAMSTPortDE) connectors.get(i).get_p1().getComponent()).getBlockGPIO2VCI() != null) 
+                        || (connectors.get(i).get_p2().getComponent() instanceof SysCAMSTPortDE && ((SysCAMSTPortDE) connectors.get(i).get_p2().getComponent()).getBlockGPIO2VCI() != null)) ) {
+                            if (connectors.get(i).get_p1().getComponent() instanceof SysCAMSTPortDE && connectors.get(i).get_p2().getComponent() instanceof SysCAMSTPortDE) {
+                                if (((SysCAMSTPortDE) connectors.get(i).get_p1().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortDE) connectors.get(i).get_p1().getComponent()).getBlockDE().getName().equals(t.getName())) {
+                                    corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(" + names.get(i) + ");" + CR;
+                                } else if (((SysCAMSTPortDE) connectors.get(i).get_p2().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortDE) connectors.get(i).get_p2().getComponent()).getBlockDE().getName().equals(t.getName())) {
+                                    corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(" + names.get(i) + ");" + CR;
+                                }
+                            } else if (connectors.get(i).get_p1().getComponent() instanceof SysCAMSTPortConverter && connectors.get(i).get_p2().getComponent() instanceof SysCAMSTPortDE) {
+                                if (((SysCAMSTPortConverter) connectors.get(i).get_p1().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortConverter) connectors.get(i).get_p1().getComponent()).getBlockTDF().getName().equals(t.getName())) {
+                                    corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(" + names.get(i) + ");" + CR;
+                                } else if (((SysCAMSTPortDE) connectors.get(i).get_p2().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortDE) connectors.get(i).get_p2().getComponent()).getBlockDE().getName().equals(t.getName())) {
+                                    corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(" + names.get(i) + ");" + CR;
+                                }
+                            } else if (connectors.get(i).get_p2().getComponent() instanceof SysCAMSTPortConverter && connectors.get(i).get_p1().getComponent() instanceof SysCAMSTPortDE) {
+                                if (((SysCAMSTPortConverter) connectors.get(i).get_p2().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortConverter) connectors.get(i).get_p2().getComponent()).getBlockTDF().getName().equals(t.getName())) {
+                                    corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(" + names.get(i) + ");" + CR;
+                                } else if (((SysCAMSTPortDE) connectors.get(i).get_p1().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortDE) connectors.get(i).get_p1().getComponent()).getBlockDE().getName().equals(t.getName())) {
+                                    corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(" + names.get(i) + ");" + CR;
+                                }
+                            }
+                        } else {
+                            if (connectors.get(i).get_p1().getComponent() instanceof SysCAMSTPortDE && ((SysCAMSTPortDE) connectors.get(i).get_p1().getComponent()).getBlockGPIO2VCI() != null) {
+                                if (connectors.get(i).get_p2().getComponent() instanceof SysCAMSTPortDE) {
+                                    if (((SysCAMSTPortDE) connectors.get(i).get_p2().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortDE) connectors.get(i).get_p2().getComponent()).getBlockDE().getName().equals(t.getName())) {
+                                        corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(in_ams);" + CR;                                    
+                                    }
+                                }
+                            } else if (connectors.get(i).get_p2().getComponent() instanceof SysCAMSTPortDE && ((SysCAMSTPortDE) connectors.get(i).get_p2().getComponent()).getBlockGPIO2VCI() != null) {
+                                if (connectors.get(i).get_p1().getComponent() instanceof SysCAMSTPortDE) {
+                                    if (((SysCAMSTPortDE) connectors.get(i).get_p1().getComponent()).getName().equals(p.getName()) && ((SysCAMSTPortDE) connectors.get(i).get_p1().getComponent()).getBlockDE().getName().equals(t.getName())) {
+                                        corpsCluster = corpsCluster + "\t\t" + t.getName() + "_" + nb_block + "." + p.getName() + "(out_ams);" + CR;                                    
+                                    }
+                                }
+                            }
+                        }
+					}
+				}
+				corpsCluster = corpsCluster + CR;
+				nb_block++;
+			}
+			
+			//  corpsCluster = corpsCluster + "\t}" + CR2;
+			
+
+//fin DG 19.09.		
+
 		corpsCluster = corpsCluster + "\t// Configure signal tracing." + CR 
 		    + "\tsca_trace_file* tfp = sca_create_tabular_trace_file(\"" + cluster.getClusterName() + "_tb\");" + CR;
 
diff --git a/src/main/java/syscamstranslator/toSysCAMS/Header.java b/src/main/java/syscamstranslator/toSysCAMS/Header.java
index 14f1efd8c6..382661ce99 100644
--- a/src/main/java/syscamstranslator/toSysCAMS/Header.java
+++ b/src/main/java/syscamstranslator/toSysCAMS/Header.java
@@ -71,7 +71,7 @@ public class Header {
 		if (tdf != null) {
 			headerPrimitiveTDF = "#ifndef " + tdf.getName().toUpperCase() + "_H"+ CR 
 					+ "#define " + tdf.getName().toUpperCase() + "_H" + CR2
-					+ "#include <cmath>" + CR + "#include <iostream>" + CR + "#include <systemc-ams.h>" + CR2;
+					+ "#include <cmath>" + CR + "#include <iostream>" + CR + "#include <systemc-ams>" + CR2;
 		} else {
 			headerPrimitiveTDF = "";
 		}
@@ -91,7 +91,7 @@ public class Header {
 	
 	public static String getClusterHeader(SysCAMSTCluster cluster) {
 		 if (cluster != null) {
-		      headerCluster = "#include <systemc-ams.h>" + CR;
+		      headerCluster = "#include <systemc-ams>" + CR;
 		      LinkedList<SysCAMSTBlockTDF> blocks = cluster.getBlockTDF();			 			
 			 
 			 for (SysCAMSTBlockTDF b : blocks) {
diff --git a/src/main/java/syscamstranslator/toSysCAMS/PrimitiveCode.java b/src/main/java/syscamstranslator/toSysCAMS/PrimitiveCode.java
index 45e8d5c8ba..6ffff8a7eb 100644
--- a/src/main/java/syscamstranslator/toSysCAMS/PrimitiveCode.java
+++ b/src/main/java/syscamstranslator/toSysCAMS/PrimitiveCode.java
@@ -577,9 +577,11 @@ if (t.getOrigin() == 0) {
 			}
 			
 			corpsPrimitiveDE = corpsPrimitiveDE + "private:" + CR +CR;
-			if(de.getClockName()!=""){
-			    corpsPrimitiveDE = corpsPrimitiveDE +"sc_in<bool> "+de.getClockName()+";"+CR;
-			}
+		        
+			//	if((de.getClockName()!="null")&&(de.getClockName()!="toto\n")){
+			
+			//	    corpsPrimitiveDE = corpsPrimitiveDE +"sc_in<bool> "+de.getClockName()+";"+CR;
+			//	}
 			if (de.getListStruct().getSize() != 0) {
 				String identifier, type, constant;
 				for (int i = 0; i < de.getListStruct().size(); i++) {
diff --git a/src/main/java/syscamstranslator/toSysCAMSCluster/HeaderCluster.java b/src/main/java/syscamstranslator/toSysCAMSCluster/HeaderCluster.java
index 3718c9515d..a5f7b5b97c 100644
--- a/src/main/java/syscamstranslator/toSysCAMSCluster/HeaderCluster.java
+++ b/src/main/java/syscamstranslator/toSysCAMSCluster/HeaderCluster.java
@@ -68,7 +68,7 @@ public class HeaderCluster {
 		if (tdf != null) {
 			headerPrimitiveTDF = "#ifndef " + tdf.getName().toUpperCase() + "_TDF_H"+ CR 
 					+ "#define " + tdf.getName().toUpperCase() + "_TDF_H" + CR2
-					+ "#include <cmath>" + CR + "#include <iostream>" + CR + "#include <systemc-ams.h>" + CR2;
+					+ "#include <cmath>" + CR + "#include <iostream>" + CR + "#include <systemc-ams>" + CR2;
 		} else {
 			headerPrimitiveTDF = "";
 		}
@@ -93,7 +93,7 @@ public class HeaderCluster {
 
              headerCluster = "#ifndef " + cluster.getClusterName().toUpperCase() + "_TDF_H"+ CR 
                     + "#define " + cluster.getClusterName().toUpperCase() + "_TDF_H" + CR2;
-             headerCluster += "#include <systemc-ams.h>" + CR;
+             headerCluster += "#include <systemc-ams>" + CR;
              
              for (SysCAMSTBlockTDF b : tdf) {
                  headerCluster = headerCluster + "#include \"" + b.getName() + "_tdf.h\"" + CR;
diff --git a/src/main/java/syscamstranslator/toSysCAMSCluster/PrimitiveCodeCluster.java b/src/main/java/syscamstranslator/toSysCAMSCluster/PrimitiveCodeCluster.java
index 6c5508653e..e5b539b7b7 100644
--- a/src/main/java/syscamstranslator/toSysCAMSCluster/PrimitiveCodeCluster.java
+++ b/src/main/java/syscamstranslator/toSysCAMSCluster/PrimitiveCodeCluster.java
@@ -532,9 +532,9 @@ public class PrimitiveCodeCluster {
 			
 			corpsPrimitiveDE = corpsPrimitiveDE + "private:" + CR;
 
-			if(de.getClockName()!=""){
-			    corpsPrimitiveDE = corpsPrimitiveDE +"sc_in<bool> "+de.getClockName()+";"+CR;
-			}
+			//if((de.getClockName()!="")&&(de.getClockName()!="")){
+			//    corpsPrimitiveDE = corpsPrimitiveDE +"sc_in<bool> "+de.getClockName()+";"+CR;
+			//	}
 			
 			if (de.getListStruct().getSize() != 0) {
 				String identifier, type, constant;
diff --git a/src/main/java/syscamstranslator/toSysCAMSSoclib/HeaderSoclib.java b/src/main/java/syscamstranslator/toSysCAMSSoclib/HeaderSoclib.java
index 742ab633c8..8185f6c552 100644
--- a/src/main/java/syscamstranslator/toSysCAMSSoclib/HeaderSoclib.java
+++ b/src/main/java/syscamstranslator/toSysCAMSSoclib/HeaderSoclib.java
@@ -71,7 +71,7 @@ public class HeaderSoclib {
 		if (tdf != null) {
 			headerPrimitiveTDF = "#ifndef " + tdf.getName().toUpperCase() + "_TDF_H"+ CR 
 					+ "#define " + tdf.getName().toUpperCase() + "_TDF_H" + CR2
-					+ "#include <cmath>" + CR + "#include <iostream>" + CR + "#include <systemc-ams.h>" + CR2;
+					+ "#include <cmath>" + CR + "#include <iostream>" + CR + "#include <systemc-ams>" + CR2;
 		} else {
 			headerPrimitiveTDF = "";
 		}
@@ -96,7 +96,7 @@ public class HeaderSoclib {
 
              headerCluster = "#ifndef " + cluster.getClusterName().toUpperCase() + "_TDF_H"+ CR 
                     + "#define " + cluster.getClusterName().toUpperCase() + "_TDF_H" + CR2;
-             headerCluster += "#include <systemc-ams.h>" + CR;
+             headerCluster += "#include <systemc-ams>" + CR;
              
              for (SysCAMSTBlockTDF b : tdf) {
                  headerCluster = headerCluster + "#include \"" + b.getName() + "_tdf.h\"" + CR;
diff --git a/src/main/java/ui/window/JDialogSysCAMSExecutableCodeGeneration.java b/src/main/java/ui/window/JDialogSysCAMSExecutableCodeGeneration.java
index 82f4e5f816..dfa9718d60 100644
--- a/src/main/java/ui/window/JDialogSysCAMSExecutableCodeGeneration.java
+++ b/src/main/java/ui/window/JDialogSysCAMSExecutableCodeGeneration.java
@@ -755,9 +755,10 @@ public class JDialogSysCAMSExecutableCodeGeneration extends javax.swing.JFrame i
                 		jta.append("Error: No SYSCAMS specification\n");
                 	} else {
                 		System.err.println("**SYSCAMS TOPCELL found");
-
-                		TopCellGenerator topCellGenerator = new TopCellGenerator(syscalsspec);
-                        TopCellGeneratorCluster topCellGeneratorCluster = new TopCellGeneratorCluster(syscalsspec);
+				//if(standalone){
+				TopCellGenerator topCellGenerator = new TopCellGenerator(syscalsspec);//}
+			//else{
+			TopCellGeneratorCluster topCellGeneratorCluster = new TopCellGeneratorCluster(syscalsspec);//}
                 		testGo();
                 		jta.append("Generation of TopCell \"" + syscalsspec.getCluster().getClusterName() + "\" executable code: done\n");
 
@@ -767,9 +768,12 @@ public class JDialogSysCAMSExecutableCodeGeneration extends javax.swing.JFrame i
                 			pathCode = code2.getText();
 
                 			System.err.println("SYSCAMS TOPCELL : " + syscalsspec.getCluster().getClusterName() + " saved in " + code2.getText());
+					//DG 16.09.2019 separate standalone from with-Soclib versions
+					if(standalone){
                 			topCellGenerator.saveFile(pathCode, standalone);
+					}else{
 					topCellGeneratorCluster.saveFile(pathCode, standalone);
-
+					}
                 			jta.append("Code saved\n");
                 		} catch (Exception e) {
                 			jta.append("Could not generate files\n");
diff --git a/src/main/java/ui/window/JDialogSysCAMSPortConverter.java b/src/main/java/ui/window/JDialogSysCAMSPortConverter.java
index 14833d45f5..3f1f8989d7 100644
--- a/src/main/java/ui/window/JDialogSysCAMSPortConverter.java
+++ b/src/main/java/ui/window/JDialogSysCAMSPortConverter.java
@@ -241,7 +241,7 @@ public class JDialogSysCAMSPortConverter extends JDialog implements ActionListen
 		listArrayTypeString.add("int");
 		listArrayTypeString.add("bool");
 		listArrayTypeString.add("double");
-		listArrayTypeString.add("sc_uint<N>");
+		listArrayTypeString.add("sc_int<N>");
 		if (port.getFather() != null) {
 			if (port.getFather() instanceof SysCAMSBlockTDF) {
 				if (!((SysCAMSBlockTDF) port.getFather()).getListTypedef().isEmpty()) {
@@ -268,7 +268,7 @@ public class JDialogSysCAMSPortConverter extends JDialog implements ActionListen
 			if (port.getConvType().equals(listArrayTypeString.get(i))) {
 				typeComboBoxString.setSelectedIndex(i);
 			}
-			if (port.getConvType().equals("sc_uint")) {
+			if (port.getConvType().equals("sc_dt::sc_int")) {
 				typeComboBoxString.setSelectedIndex(3);
 			}
 		}
@@ -408,9 +408,9 @@ public class JDialogSysCAMSPortConverter extends JDialog implements ActionListen
 				port.setDelay(-1);
 			}
 			
-			if(typeComboBoxString.getSelectedItem()=="sc_uint<N>"){
-			 port.setConvType("sc_uint<"+nbitsTextField.getText()+"> ");
-				     port.setConvType("sc_uint");
+			if(typeComboBoxString.getSelectedItem()=="sc_int<N>"){
+			    //port.setConvType("sc_dt::sc_int<"+nbitsTextField.getText()+"> ");
+				     port.setConvType("sc_dt::sc_int");
 				     port.setNbits(Integer.parseInt(nbitsTextField.getText()));
 			
 					
diff --git a/src/main/java/ui/window/JDialogSysCAMSPortDE.java b/src/main/java/ui/window/JDialogSysCAMSPortDE.java
index 69ffa9f6c4..514a091818 100644
--- a/src/main/java/ui/window/JDialogSysCAMSPortDE.java
+++ b/src/main/java/ui/window/JDialogSysCAMSPortDE.java
@@ -217,7 +217,7 @@ public class JDialogSysCAMSPortDE extends JDialog implements ActionListener {
 			listArrayTypeString.add("int");
 			listArrayTypeString.add("bool");
 			listArrayTypeString.add("double");
-		listArrayTypeString.add("sc_uint<N>");
+		listArrayTypeString.add("sc_int<N>");
 		
 		if (port.getFather() != null) {
 			if (port.getFather() instanceof SysCAMSBlockDE) {
@@ -247,7 +247,7 @@ public class JDialogSysCAMSPortDE extends JDialog implements ActionListener {
 				typeComboBoxString.setSelectedIndex(i);
 			
 			}
-			if (port.getDEType().equals("sc_uint")) {
+			if (port.getDEType().equals("sc_dt::sc_int")) {
 				typeComboBoxString.setSelectedIndex(3);
 			
 			}
@@ -433,9 +433,9 @@ public class JDialogSysCAMSPortDE extends JDialog implements ActionListener {
 
 		       
 		
-				if(typeComboBoxString.getSelectedItem()=="sc_uint<N>"){
-			    //	port.setDEType((String)"sc_uint<"+nbitsTextField.getText()+"> ");
-			    port.setDEType("sc_uint");
+				if(typeComboBoxString.getSelectedItem()=="sc_int<N>"){
+			    //	port.setDEType((String)"sc_int<"+nbitsTextField.getText()+"> ");
+			    port.setDEType("sc_dt::sc_int");
 				 
 			 
 			    	}		
-- 
GitLab