From f12c4f1dc014749db68e68d24ac4c15668b27c43 Mon Sep 17 00:00:00 2001 From: Letitia Li <leli@enst.fr> Date: Fri, 16 Sep 2016 13:13:03 +0000 Subject: [PATCH] nocolor verification --- src/ui/GTMLModeling.java | 1 - src/ui/GTURTLEModeling.java | 9 +++++++-- src/ui/tmlad/TMLADReadChannel.java | 5 ++++- src/ui/tmlad/TMLADWriteChannel.java | 5 ++++- src/ui/tmlcompd/TMLCPrimitivePort.java | 13 ++++++++++++- src/ui/tmldd/TMLArchiArtifact.java | 1 - src/ui/window/JDialogArchiKey.java | 2 ++ .../window/JDialogCryptographicConfiguration.java | 8 ++++++-- src/ui/window/JDialogDSE.java | 12 ++++++++++-- 9 files changed, 45 insertions(+), 11 deletions(-) diff --git a/src/ui/GTMLModeling.java b/src/ui/GTMLModeling.java index 25019fad56..8e459efde9 100755 --- a/src/ui/GTMLModeling.java +++ b/src/ui/GTMLModeling.java @@ -2506,7 +2506,6 @@ if (tgc instanceof TMLArchiCrossbarNode) { while(iterator.hasNext()) { tgc = (TGComponent)(iterator.next()); if (tgc instanceof TMLArchiConnectorNode) { - //TraceManager.addDev("Found link"); connector = (TMLArchiConnectorNode)tgc; tgc1 = null; tgc2 = null; p1 = connector.getTGConnectingPointP1(); diff --git a/src/ui/GTURTLEModeling.java b/src/ui/GTURTLEModeling.java index 8287f73cd9..709e35396e 100755 --- a/src/ui/GTURTLEModeling.java +++ b/src/ui/GTURTLEModeling.java @@ -699,6 +699,7 @@ public class GTURTLEModeling { TMLModeling tmlmodel = map.getTMLModeling(); java.util.List<TMLChannel> channels = tmlmodel.getChannels(); for (TMLChannel channel: channels){ + System.out.println(channel.getName()); for (TMLCPrimitivePort p: channel.ports){ channel.checkConf = channel.checkConf || p.checkConf; channel.checkAuth = channel.checkAuth || p.checkAuth; @@ -733,9 +734,12 @@ public class GTURTLEModeling { if (tg instanceof TMLADWriteChannel){ TMLADWriteChannel writeChannel = (TMLADWriteChannel) tg; if (writeChannel.securityContext.equals("")){ + TMLChannel chan = tmlmodel.getChannelByName(tabName+"__"+writeChannel.getChannelName()); + //System.out.println("channel " + chan); if (chan!=null){ if (chan.checkConf){ + System.out.println("F#$%^&*( "); if (!securePath(map, chan.getOriginTask(), chan.getDestinationTask())){ insecureOutChannels.get(chan.getOriginTask()).add(writeChannel.getChannelName()); insecureInChannels.get(chan.getDestinationTask()).add(writeChannel.getChannelName()); @@ -748,10 +752,10 @@ public class GTURTLEModeling { } } } + System.out.println("tosecure " + toSecure); int num=0; int nonceNum=0; //Create reverse channels to send nonces if they don't already exist - System.out.println("tosecrev " +toSecureRev); if (autoAuth){ for (TMLTask task: toSecureRev.keySet()){ @@ -971,7 +975,6 @@ public class GTURTLEModeling { task.setName(tabName+"_"+name+"__"+task.getName()); } for (TMLTask task: tmlmodel.getTasks()){ - System.out.println(task.getName()); HwExecutionNode node =(HwExecutionNode) map.getHwNodeOf(task); if (newmodel.getTMLTaskByName(task.getName().replace(tabName,tabName+"_"+name))!=null){ map.addTaskToHwExecutionNode(newmodel.getTMLTaskByName(task.getName().replace(tabName,tabName+"_"+name)), node); @@ -997,6 +1000,7 @@ public class GTURTLEModeling { java.util.List<HwNode> done = new ArrayList<HwNode>(); java.util.List<HwNode> path = new ArrayList<HwNode>(); Map<HwNode, java.util.List<HwNode>> pathMap = new HashMap<HwNode, java.util.List<HwNode>>(); + System.out.println("Links " + links); if (node1==node2){ return true; } @@ -1036,6 +1040,7 @@ public class GTURTLEModeling { done.add(curr); } if (path.size() ==0){ + System.out.println("no path"); return true; } else { diff --git a/src/ui/tmlad/TMLADReadChannel.java b/src/ui/tmlad/TMLADReadChannel.java index 59ed46ddb9..8f72bc3dc0 100755 --- a/src/ui/tmlad/TMLADReadChannel.java +++ b/src/ui/tmlad/TMLADReadChannel.java @@ -179,7 +179,10 @@ public class TMLADReadChannel extends TGCWithoutInternalComponent implements Che g.fillRect(x-12, y-7, 9, 7); g.setColor(c); g.drawRect(x-12, y-7, 9, 7); - + if (reachabilityInformation==NOT_REACHABLE){ + g.drawLine(x-14, y-9, x-1, y+3); + g.drawLine(x-14, y+3, x-1, y-9); + } } } diff --git a/src/ui/tmlad/TMLADWriteChannel.java b/src/ui/tmlad/TMLADWriteChannel.java index 0228f71a3b..1f15811b8b 100755 --- a/src/ui/tmlad/TMLADWriteChannel.java +++ b/src/ui/tmlad/TMLADWriteChannel.java @@ -176,7 +176,10 @@ public class TMLADWriteChannel extends TGCWithoutInternalComponent implements Ch g.fillRect(x-12, y-7, 9, 7); g.setColor(c); g.drawRect(x-12, y-7, 9, 7); - + if (reachabilityInformation==NOT_REACHABLE){ + g.drawLine(x-14, y-9, x-1, y+3); + g.drawLine(x-14, y+3, x-1, y-9); + } } } public TGComponent isOnMe(int _x, int _y) { diff --git a/src/ui/tmlcompd/TMLCPrimitivePort.java b/src/ui/tmlcompd/TMLCPrimitivePort.java index a3bb29243d..2dc87b21bd 100755 --- a/src/ui/tmlcompd/TMLCPrimitivePort.java +++ b/src/ui/tmlcompd/TMLCPrimitivePort.java @@ -362,6 +362,14 @@ public abstract class TMLCPrimitivePort extends TGCScalableWithInternalComponent g.drawPolygon(xpw, ypw, 3); g.drawString("S", x-18, y+30); g.drawString("W", x-11, y+26); + if (checkSecStrongAuthStatus ==3){ + g.drawLine(x-19, y+22, x-12, y+30); + g.drawLine(x-19, y+30, x-12, y+22); + } + if (checkSecWeakAuthStatus==3 || checkSecStrongAuthStatus==3 && checkWeakAuthStatus <2){ + g.drawLine(x-12, y+18, x-5, y+26); + g.drawLine(x-12, y+26, x-5, y+18); + } } public void drawConfVerification(Graphics g){ Color c = g.getColor(); @@ -385,7 +393,10 @@ public abstract class TMLCPrimitivePort extends TGCScalableWithInternalComponent g.fillRect(x-12, y+3, 9, 7); g.setColor(c); g.drawRect(x-12, y+3, 9, 7); - + if (checkConfStatus==3){ + g.drawLine(x-14, y+1, x-1, y+13); + g.drawLine(x-14, y+13, x-1, y+1); + } if (!secName.equals("")){ diff --git a/src/ui/tmldd/TMLArchiArtifact.java b/src/ui/tmldd/TMLArchiArtifact.java index 03d054ee22..a4c8efe4fa 100755 --- a/src/ui/tmldd/TMLArchiArtifact.java +++ b/src/ui/tmldd/TMLArchiArtifact.java @@ -143,7 +143,6 @@ public class TMLArchiArtifact extends TGCWithoutInternalComponent implements Swa } g.fillRect(x+1, y+1, width-1, height-1); g.setColor(c); - g.drawString(value, x + textX , y + textY); //g.drawRoundRect(x, y, width, height, arc, arc); g.drawLine(x+width-space-fileX, y + space, x+width-space-fileX, y+space+fileY); diff --git a/src/ui/window/JDialogArchiKey.java b/src/ui/window/JDialogArchiKey.java index 1551d04244..273a3054f0 100644 --- a/src/ui/window/JDialogArchiKey.java +++ b/src/ui/window/JDialogArchiKey.java @@ -139,8 +139,10 @@ public class JDialogArchiKey extends javax.swing.JDialog implements ActionListen TraceManager.addDev("Got keyss"); referenceCommunicationName = new JComboBox(list.toArray(new String[list.size()])); + if (referenceCommunicationName.getItemCount() >index){ referenceCommunicationName.setSelectedIndex(index); referenceCommunicationName.addActionListener(this); + } //referenceTaskName.setEditable(true); //referenceTaskName.setFont(new Font("times", Font.PLAIN, 12)); panel2.add(referenceCommunicationName, c1); diff --git a/src/ui/window/JDialogCryptographicConfiguration.java b/src/ui/window/JDialogCryptographicConfiguration.java index cfb5239780..56e000509a 100644 --- a/src/ui/window/JDialogCryptographicConfiguration.java +++ b/src/ui/window/JDialogCryptographicConfiguration.java @@ -297,7 +297,9 @@ public class JDialogCryptographicConfiguration extends javax.swing.JDialog imple c1.gridwidth = 1; add(new JLabel("Nonce"),c1); helps[5]=new JComboBox(nonces); - helps[5].setSelectedItem(values[5]); + if (helps[5].getItemCount() > 0){ + helps[5].setSelectedItem(values[5]); + } add(helps[5],c1); c1.gridwidth=GridBagConstraints.REMAINDER; inserts[5] = new JButton("Use"); @@ -309,7 +311,9 @@ public class JDialogCryptographicConfiguration extends javax.swing.JDialog imple c1.gridwidth = 1; add(new JLabel("Encrypted Key"),c1); helps[8]=new JComboBox(keys); - helps[8].setSelectedItem(values[8]); + if (helps[8].getItemCount() > 0){ + helps[8].setSelectedItem(values[8]); + } add(helps[8],c1); c1.gridwidth=GridBagConstraints.REMAINDER; inserts[8] = new JButton("Use"); diff --git a/src/ui/window/JDialogDSE.java b/src/ui/window/JDialogDSE.java index 7ab929ce86..02a6666738 100644 --- a/src/ui/window/JDialogDSE.java +++ b/src/ui/window/JDialogDSE.java @@ -105,8 +105,8 @@ public class JDialogDSE extends javax.swing.JDialog implements ActionListener, R String mapFile = "spec.tmap"; String modFile = "spec.tml"; String resDirect; - String simThreads="1000"; - String simCycles="1000"; + String simThreads="10"; + String simCycles="10000"; String NbMinCPU ="1"; String NbMaxCPU ="1"; String Nbsim ="100"; @@ -712,6 +712,13 @@ public class JDialogDSE extends javax.swing.JDialog implements ActionListener, R output+="Simulation threads error: "+simThreads+"\n"; return; } + + if (config.setNbOfSimulationsPerMapping(Nbsim) != 0) { + TraceManager.addDev("Simulations per mapping error: "+Nbsim); + output+="Simulation per mapping error: "+Nbsim+"\n"; + return; + } + if (config.setSimulationCompilationCommand("make -j9 -C") !=0){ TraceManager.addDev("Simulation compilation error"); output+="Simulation compilation error"+"\n"; @@ -730,6 +737,7 @@ public class JDialogDSE extends javax.swing.JDialog implements ActionListener, R TraceManager.addDev("Can't set Max # CPUS to " + NbMaxCPU); output+="Can't set Max # CPUS to " + NbMaxCPU +"\n"; } + config.setOutputTXT("true"); // config.setOutputHTML("true"); // config.setOutputVCD("true"); -- GitLab