Commit ed201590 authored by Ludovic Apvrille's avatar Ludovic Apvrille

Merge branch 'latencyDetailedAnalysis' into 'master'

Latency detailed analysis

See merge request !260
parents 42f25c48 503179da
......@@ -26,6 +26,10 @@ dependencies {
compile name:'jautomata-core'
compile name:'com.microsoft.z3'
compileOnly name: 'jna-3.3.0'
compile name: 'jgrapht-core-1.3.0'
compile name: 'jgrapht-ext-1.3.0'
compile name: 'jgrapht-io-1.3.0'
compile name: 'jgraphx-3.4.1.3'
}
jar {
......
......@@ -36,7 +36,6 @@
* knowledge of the CeCILL license and that you accept its terms.
*/
package tmltranslator;
import myutil.TraceManager;
......@@ -44,8 +43,7 @@ import myutil.TraceManager;
import java.util.*;
/**
* Class TMLArchitecture
* Creation: 05/09/2007
* Class TMLArchitecture Creation: 05/09/2007
*
* @author Ludovic APVRILLE
* @version 1.1 19/05/2008
......@@ -59,7 +57,6 @@ public class TMLArchitecture {
private int hashCode;
private boolean hashCodeComputed = false;
public TMLArchitecture() {
init();
}
......@@ -70,10 +67,10 @@ public class TMLArchitecture {
}
private void computeHashCode() {
TMLArchiTextSpecification architxt = new TMLArchiTextSpecification(/*"spec.tarchi"*/);
TMLArchiTextSpecification architxt = new TMLArchiTextSpecification(/* "spec.tarchi" */);
String s = architxt.toTextFormat(this);
hashCode = s.hashCode();
//TraceManager.addDev("TARCHI hashcode = " + hashCode);
// TraceManager.addDev("TARCHI hashcode = " + hashCode);
}
public int getHashCode() {
......@@ -93,7 +90,6 @@ public class TMLArchitecture {
return masterClockFrequency;
}
public void addHwNode(HwNode _node) {
hwnodes.add(_node);
}
......@@ -137,7 +133,6 @@ public class TMLArchitecture {
addHwLink(link);
}
public boolean hasCPU() {
for (HwNode node : hwnodes) {
if (node instanceof HwCPU) {
......@@ -149,7 +144,7 @@ public class TMLArchitecture {
public boolean hasHwExecutionNode() {
for (HwNode node : hwnodes) {
if ((node instanceof HwCPU)|| (node instanceof HwA)|| (node instanceof HwFPGA)) {
if ((node instanceof HwCPU) || (node instanceof HwA) || (node instanceof HwFPGA)) {
return true;
}
}
......@@ -258,7 +253,6 @@ public class TMLArchitecture {
return list;
}
public int getNbOfCPU() {
int cpt = 0;
for (HwNode node : hwnodes) {
......@@ -279,7 +273,6 @@ public class TMLArchitecture {
return cpt;
}
public int getNbOfMem() {
int cpt = 0;
for (HwNode node : hwnodes) {
......@@ -300,9 +293,9 @@ public class TMLArchitecture {
public HwNode getHwNodeByName(String _name) {
for (HwNode node : hwnodes) {
//TraceManager.addDev("Comparing >" + node.getName() + "< vs >" + _name + "<");
// TraceManager.addDev("Comparing >" + node.getName() + "< vs >" + _name + "<");
if (node.getName().compareTo(_name) == 0) {
//TraceManager.addDev("Returning node " + node.getName());
// TraceManager.addDev("Returning node " + node.getName());
return node;
}
}
......@@ -389,7 +382,8 @@ public class TMLArchitecture {
List<HwLink> tempList = new ArrayList<HwLink>();
for (HwLink link : hwlinks) {
if (link.hwnode == node) tempList.add(link);
if (link.hwnode == node)
tempList.add(link);
}
return tempList;
......@@ -406,7 +400,8 @@ public class TMLArchitecture {
public boolean isNodeConnectedToBus(HwNode node, HwBus bus) {
for (HwLink link : hwlinks) {
if (node == link.hwnode && bus == link.bus) return true;
if (node == link.hwnode && bus == link.bus)
return true;
}
return false;
}
......@@ -415,7 +410,8 @@ public class TMLArchitecture {
List<HwLink> tempList = new ArrayList<HwLink>();
for (HwLink link : hwlinks) {
if (link.bus == bus) tempList.add(link);
if (link.bus == bus)
tempList.add(link);
}
return tempList;
......@@ -430,17 +426,17 @@ public class TMLArchitecture {
if (node instanceof HwCPU) {
HwCPU cpu = (HwCPU) node;
complexity += cpu.nbOfCores * cpu.byteDataSize * cpu.pipelineSize;
//TraceManager.addDev("complexity CPU= " + complexity);
// TraceManager.addDev("complexity CPU= " + complexity);
}
if (node instanceof HwBus) {
HwBus bus = (HwBus) node;
complexity += bus.byteDataSize * bus.pipelineSize;
//TraceManager.addDev("complexity bus= " + complexity);
// TraceManager.addDev("complexity bus= " + complexity);
}
}
//TraceManager.addDev("Complexity = " + complexity);
// TraceManager.addDev("Complexity = " + complexity);
return complexity;
}
......@@ -476,11 +472,10 @@ public class TMLArchitecture {
return false;
}
// For NoC manipulation
public void removeAllNonHwExecutionNodes() {
List<HwNode> newList = new ArrayList<HwNode>();
for(HwNode node: hwnodes) {
for (HwNode node : hwnodes) {
if (node instanceof HwExecutionNode) {
newList.add(node);
}
......@@ -489,9 +484,9 @@ public class TMLArchitecture {
}
public HwNoC getHwNoC() {
for(HwNode node: hwnodes) {
for (HwNode node : hwnodes) {
if (node instanceof HwNoC) {
return ((HwNoC)node);
return ((HwNoC) node);
}
}
return null;
......@@ -503,17 +498,60 @@ public class TMLArchitecture {
}
public boolean equalSpec(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
TMLArchitecture that = (TMLArchitecture) o;
TMLComparingMethod comp = new TMLComparingMethod();
if (!comp.isHwNodeListEquals(hwnodes, that.hwnodes)) return false;
if (!comp.isHwNodeListEquals(hwnodes, that.hwnodes))
return false;
if(!comp.isHwlinkListEquals(hwlinks, that.hwlinks)) return false;
if (!comp.isHwlinkListEquals(hwlinks, that.hwlinks))
return false;
return masterClockFrequency == that.masterClockFrequency;
}
public List<HwNode> getBUSs() {
List<HwNode> buss = new ArrayList<HwNode>();
for (HwNode node : hwnodes) {
if (node instanceof HwBus) {
buss.add(node);
}
}
return buss;
}
public List<HwMemory> getMemories() {
List<HwMemory> list = new ArrayList<HwMemory>();
for (HwNode node : hwnodes) {
if (node instanceof HwMemory) {
HwMemory memory = (HwMemory) node;
list.add(memory);
}
}
return list;
}
public List<HwBridge> getHwBridge() {
List<HwBridge> bridgeList = new ArrayList<HwBridge>();
for (HwNode node : hwnodes) {
if (node instanceof HwBridge) {
HwBridge bridge = (HwBridge) node;
bridgeList.add(bridge);
}
}
return bridgeList;
}
}
This diff is collapsed.
This diff is collapsed.
......@@ -36,7 +36,6 @@
* knowledge of the CeCILL license and that you accept its terms.
*/
package ui;
import common.ConfigurationTTool;
......@@ -48,19 +47,16 @@ import javax.swing.*;
//import java.awt.*;
//import java.awt.event.*;
/**
* Class JMenuBarTurtle
* Creation: 09/12/2003
* Version 1.0 09/12/2003
* Version 1.5 11/10/2018
* Class JMenuBarTurtle Creation: 09/12/2003 Version 1.0 09/12/2003 Version 1.5
* 11/10/2018
*
* @author Ludovic APVRILLE, Arthur VUAGNIAUX
*/
public class JMenuBarTurtle extends JMenuBar {
private JMenu menugraph;
//Menu
// Menu
private JMenu file, saveLastGraph, diagram, cd, ad, iod, ucd, sd, edit, vAndV, codeG, view, tool, capture, ontologies, help;
public JMenuBarTurtle(MainGUI mgui) {
......@@ -80,7 +76,6 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem.addActionListener(mgui);
}
public void makeFileMenu(MainGUI mgui) {
JMenuItem menuItem;
......@@ -172,8 +167,9 @@ public class JMenuBarTurtle extends JMenuBar {
if (ConfigurationTTool.LastOpenFileDefined) {
file.addSeparator();
for(int i=0; i<ConfigurationTTool.LastOpenFiles.length;i++){
//TraceManager.addDev("Considering last open file: " + ConfigurationTTool.LastOpenFiles[i]);
for (int i = 0; i < ConfigurationTTool.LastOpenFiles.length; i++) {
// TraceManager.addDev("Considering last open file: " +
// ConfigurationTTool.LastOpenFiles[i]);
if ((ConfigurationTTool.LastOpenFiles[i] != null) && (ConfigurationTTool.LastOpenFiles[i].length() > 0)) {
menuItem = file.add(mgui.actionsLast[i]);
menuItem.addMouseListener(mgui.mouseHandler);
......@@ -203,7 +199,7 @@ public class JMenuBarTurtle extends JMenuBar {
JMenuItem menuItem;
makeFileMenu(mgui);
//Edit
// Edit
menuItem = edit.add(mgui.actions[TGUIAction.ACT_CUT]);
menuItem.setName("Edit Cut");
menuItem.addMouseListener(mgui.mouseHandler);
......@@ -290,10 +286,12 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem = iod.add(mgui.actions[TGUIAction.IOD_PARALLEL]);
menuItem.setName("Iod Parallel");
menuItem.addMouseListener(mgui.mouseHandler);
/*menuItem = iod.add(mgui.actions[TGUIAction.IOD_SEQUENCE]);
menuItem.addMouseListener(mgui.mouseHandler);
menuItem = iod.add(mgui.actions[TGUIAction.IOD_PREEMPTION]);
menuItem.addMouseListener(mgui.mouseHandler);*/
/*
* menuItem = iod.add(mgui.actions[TGUIAction.IOD_SEQUENCE]);
* menuItem.addMouseListener(mgui.mouseHandler); menuItem =
* iod.add(mgui.actions[TGUIAction.IOD_PREEMPTION]);
* menuItem.addMouseListener(mgui.mouseHandler);
*/
menuItem = iod.add(mgui.actions[TGUIAction.IOD_CHOICE]);
menuItem.setName("Iod Choice");
menuItem.addMouseListener(mgui.mouseHandler);
......@@ -517,7 +515,7 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem.setName("Ad Time Limited Latency");
menuItem.addMouseListener(mgui.mouseHandler);
// V&V
// V&V
menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_MODEL_CHECKING]);
menuItem.setName("V&V Syntax Analysis");
menuItem.addMouseListener(mgui.mouseHandler);
......@@ -528,7 +526,6 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem.setName("V&V Gen RTLOTOS");
menuItem.addMouseListener(mgui.mouseHandler);
if (MainGUI.lotosOn) {
menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_GEN_LOTOS]);
menuItem.setName("V&V Gen LOTOS");
......@@ -547,10 +544,12 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem.setName("V&V Gen Design");
menuItem.addMouseListener(mgui.mouseHandler);
/*vAndV.addSeparator();
menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_GEN_JAVA]);
menuItem.addMouseListener(mgui.mouseHandler);*/
/*
* vAndV.addSeparator();
*
* menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_GEN_JAVA]);
* menuItem.addMouseListener(mgui.mouseHandler);
*/
vAndV.addSeparator();
......@@ -592,13 +591,15 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem.setName("V&V Saved Aut");
menuItem.addMouseListener(mgui.mouseHandler);
/*vAndV.addSeparator();
menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_VIEW_PM_AUT]);
menuItem.addMouseListener(mgui.mouseHandler);
menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_VIEW_PM_AUTPROJ]);
menuItem.addMouseListener(mgui.mouseHandler);
menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_VIEW_PM_SAVED_AUT]);
menuItem.addMouseListener(mgui.mouseHandler);*/
/*
* vAndV.addSeparator(); menuItem =
* vAndV.add(mgui.actions[TGUIAction.ACT_VIEW_PM_AUT]);
* menuItem.addMouseListener(mgui.mouseHandler); menuItem =
* vAndV.add(mgui.actions[TGUIAction.ACT_VIEW_PM_AUTPROJ]);
* menuItem.addMouseListener(mgui.mouseHandler); menuItem =
* vAndV.add(mgui.actions[TGUIAction.ACT_VIEW_PM_SAVED_AUT]);
* menuItem.addMouseListener(mgui.mouseHandler);
*/
vAndV.addSeparator();
menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_AVATAR_SIM]);
......@@ -614,13 +615,13 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem.setName("V&V Avatar Static Analysis");
menuItem.addMouseListener(mgui.mouseHandler);
/*vAndV.addSeparator();
menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_DEADLOCK_SEEKER_AUT]);
menuItem.addMouseListener(mgui.mouseHandler);
menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_DEADLOCK_SEEKER_SAVED_AUT]);
menuItem.addMouseListener(mgui.mouseHandler);*/
/*
* vAndV.addSeparator(); menuItem =
* vAndV.add(mgui.actions[TGUIAction.ACT_DEADLOCK_SEEKER_AUT]);
* menuItem.addMouseListener(mgui.mouseHandler); menuItem =
* vAndV.add(mgui.actions[TGUIAction.ACT_DEADLOCK_SEEKER_SAVED_AUT]);
* menuItem.addMouseListener(mgui.mouseHandler);
*/
// Code generation
......@@ -646,6 +647,13 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem.setName("CodeG Executable");
menuItem.addMouseListener(mgui.mouseHandler);
if (mgui.isExperimentalOn()) {
vAndV.addSeparator();
menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_GEN_LATENCY_GRAPH]);
menuItem.setName("Latency Detailed Analysis");
menuItem.addMouseListener(mgui.mouseHandler);
}
// View
menuItem = view.add(mgui.actions[TGUIAction.ACT_VIEW_BIRDEYES_EMB]);
menuItem.setName("View Hide Birdeye");
......@@ -704,14 +712,12 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem.setName("View Saved Graph");
menuItem.addMouseListener(mgui.mouseHandler);
/*if (MainGUI.systemcOn) {
view.addSeparator();
menuItem = view.add(mgui.actions[TGUIAction.ACT_VIEW_WAVE]);
menuItem.addMouseListener(mgui.mouseHandler);
view.addSeparator();
menugraph = new JMenu("View generated automata");
view.add(menugraph);
}*/
/*
* if (MainGUI.systemcOn) { view.addSeparator(); menuItem =
* view.add(mgui.actions[TGUIAction.ACT_VIEW_WAVE]);
* menuItem.addMouseListener(mgui.mouseHandler); view.addSeparator(); menugraph
* = new JMenu("View generated automata"); view.add(menugraph); }
*/
// Tool
capture = new JMenu("Capture");
......@@ -739,7 +745,6 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem.setName("Capture Selected");
menuItem.addMouseListener(mgui.mouseHandler);
ontologies = new JMenu("Ontologies");
tool.add(ontologies);
menuItem = ontologies.add(mgui.actions[TGUIAction.ACT_GENERATE_ONTOLOGIES_CURRENT_DIAGRAM]);
......@@ -777,7 +782,6 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem.setName("Tool Search");
menuItem.addMouseListener(mgui.mouseHandler);
// HELP
menuItem = help.add(mgui.actions[TGUIAction.ACT_INTEGRATED_HELP]);
menuItem.setName("Help");
......@@ -806,14 +810,14 @@ public class JMenuBarTurtle extends JMenuBar {
// MenuBar
add(file);
add(edit);
//add(diagram);
// add(diagram);
add(vAndV);
add(codeG);
add(view);
add(tool);
add(help);
//menuItem.setName("Menu Item");
// menuItem.setName("Menu Item");
}
} // Class
This diff is collapsed.
......@@ -183,6 +183,7 @@ public class ModeManager {
actions[TGUIAction.ACT_GEN_AUT].setEnabled(true);
actions[TGUIAction.ACT_GEN_AUTS].setEnabled(true);
actions[TGUIAction.ACT_GEN_UPPAAL].setEnabled(true);
actions[TGUIAction.ACT_GEN_LATENCY_GRAPH].setEnabled(true);
break;
case MainGUI.AVATAR_SYNTAXCHECKING_OK:
actions[TGUIAction.ACT_AVATAR_SIM].setEnabled(true);
......@@ -252,6 +253,7 @@ public class ModeManager {
actions[TGUIAction.ACT_AVATAR_FV_PROVERIF].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_FV_STATICANALYSIS].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION].setEnabled(false);
actions[TGUIAction.ACT_GEN_LATENCY_GRAPH].setEnabled(false);
break;
case MainGUI.METHO_CHANGED:
actions[TGUIAction.ACT_GEN_RTLOTOS].setEnabled(false);
......@@ -300,6 +302,7 @@ public class ModeManager {
actions[TGUIAction.ACT_AVATAR_FV_PROVERIF].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_FV_STATICANALYSIS].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION].setEnabled(false);
actions[TGUIAction.ACT_GEN_LATENCY_GRAPH].setEnabled(false);
break;
case MainGUI.MODEL_SAVED:
......
......@@ -678,6 +678,8 @@ public class TGUIAction extends AbstractAction {
public static final int MOVE_ENABLED = 463;
public static final int FIRST_DIAGRAM = 464;
public static final int ACT_GEN_LATENCY_GRAPH = 519;
public static final int NB_ACTION = 525;
private static final TAction [] actions = new TAction[NB_ACTION];
......@@ -1405,6 +1407,7 @@ public class TGUIAction extends AbstractAction {
actions[MOVE_ENABLED] = new TAction("Move", "Move enabled", IconManager.imgic780, IconManager.imgic780, "Move enabled (shift + arrow)", "Move", 0);
actions[FIRST_DIAGRAM] = new TAction("FirstDiagram", "First Diagram", IconManager.imgic142, IconManager.imgic142, "Switch the the first diagram", "Switch to the first diagram", 0);
actions[ACT_GEN_LATENCY_GRAPH] = new TAction("generate-latency-graph", "Analyze Latency Graph", IconManager.imgic1118, IconManager.imgic1118, "Analyze Latency Graph", "Analyze Latency Graph", '0');
}
public String getActionCommand() {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -95,6 +95,7 @@ public class SimulationTransactionParser extends DefaultHandler {
st.length = attributes.getValue("length");
st.virtualLength = attributes.getValue("virtuallength");
st.channelName = attributes.getValue("ch");
st.id = attributes.getValue("id");
if (trans == null) {
trans = new Vector<SimulationTransaction>();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment