Skip to content
Snippets Groups Projects
Commit b353c552 authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

DSE: Update on result gathering: bus and CPU

parent c077267d
No related branches found
No related tags found
No related merge requests found
...@@ -7,16 +7,20 @@ OPT = -O3 -pthread ...@@ -7,16 +7,20 @@ OPT = -O3 -pthread
# Solaris # Solaris
#LOPT = -O1 -pthread -ldl -lnsl -lsocket #LOPT = -O1 -pthread -ldl -lnsl -lsocket
#Linux #Linux
LOPT = -O3 -pthread -ldl LOPT = -O3 -ldl
LTHREAD = -pthread
DEBUG = -g DEBUG = -g
PROFILE = -pg PROFILE = -pg
OTHER = -Wall OTHER = -Wall
SOLARIS_SPECIFIC = -lsocket -lnsl
TRY = -Wno-deprecated TRY = -Wno-deprecated
#make = $(OPT) $(OTHER) $(TRY) #make = $(OPT) $(OTHER) $(TRY)
LFLAGS = $(LOPT) $(OTHER) $(TRY) LFLAGS = $(LOPT) $(OTHER) $(TRY)
LFLAGS_SOLARIS = $(LFLAGS) $(SOLARIS_SPECIFIC)
CFLAGS = $(OTHER) CFLAGS = $(OTHER)
OBJDIR = lib OBJDIR = lib
OS := $(shell uname)
MODULE = run MODULE = run
include Makefile.src include Makefile.src
......
...@@ -10,8 +10,14 @@ EXE = $(MODULE).x ...@@ -10,8 +10,14 @@ EXE = $(MODULE).x
.SUFFIXES: .cpp .o .x .SUFFIXES: .cpp .o .x
$(EXE): makedir $(OBJS) $(OBJS_simulator) $(EXE): makedir $(OBJS) $(OBJS_simulator)
$(CC) $(LFLAGS) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(OBJS_simulator) $(LIBS) 2>&1 | c++filt echo Making target
ifeq ($(OS), SunOS)
$(CC) $(LFLAGS_SOLARIS) -lsocket $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(OBJS_simulator) $(LIBS) 2>&1 | c++filt
endif
ifneq ($(OS), SunOS)
$(CC) $(LFLAGS) $(LTHREAD) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(OBJS_simulator) $(LIBS) 2>&1 | c++filt
endif
makedir: makedir:
echo Making directories echo Making directories
......
...@@ -65,10 +65,12 @@ public class DSESimulationResult { ...@@ -65,10 +65,12 @@ public class DSESimulationResult {
protected static final String SIMULATION_HEADER = "siminfo"; protected static final String SIMULATION_HEADER = "siminfo";
protected static final String SIMULATION_CPU = "cpu"; protected static final String SIMULATION_CPU = "cpu";
protected static final String SIMULATION_BUS = "bus"; protected static final String SIMULATION_BUS = "bus";
protected static final String SIMULATION_TASK = "task";
private Vector<CPUResult> cpus; private Vector<CPUResult> cpus;
private Vector<BusResult> busses; private Vector<BusResult> busses;
private Vector<TaskResult> tasks;
public DSESimulationResult() { public DSESimulationResult() {
reset(); reset();
...@@ -77,6 +79,7 @@ public class DSESimulationResult { ...@@ -77,6 +79,7 @@ public class DSESimulationResult {
public void reset() { public void reset() {
cpus = new Vector<CPUResult>(); cpus = new Vector<CPUResult>();
busses = new Vector<BusResult>(); busses = new Vector<BusResult>();
tasks = new Vector<TaskResult>();
} }
public int loadResultFromXMLFile(String pathToFile) { public int loadResultFromXMLFile(String pathToFile) {
...@@ -114,6 +117,12 @@ public class DSESimulationResult { ...@@ -114,6 +117,12 @@ public class DSESimulationResult {
loadXMLInfoFromServer(ssxml); loadXMLInfoFromServer(ssxml);
ssxml = ""; ssxml = "";
} }
TraceManager.addDev("Computing results");
TraceManager.addDev("infos on cpus:" + cpus.size());
TraceManager.addDev("infos on busses:" + busses.size());
TraceManager.addDev("infos on tasks:" + tasks.size());
//System.out.println("toto4"); //System.out.println("toto4");
} }
...@@ -153,7 +162,6 @@ public class DSESimulationResult { ...@@ -153,7 +162,6 @@ public class DSESimulationResult {
for(i=0; i<nl.getLength(); i++) { for(i=0; i<nl.getLength(); i++) {
node = nl.item(i); node = nl.item(i);
//System.out.println("Node = " + dnd);
if (node.getNodeType() == Node.ELEMENT_NODE) { if (node.getNodeType() == Node.ELEMENT_NODE) {
// create design, and get an index for it // create design, and get an index for it
return loadConfiguration(node); return loadConfiguration(node);
...@@ -181,30 +189,6 @@ public class DSESimulationResult { ...@@ -181,30 +189,6 @@ public class DSESimulationResult {
Node node, node0, node00; Node node, node0, node00;
NodeList nl, nl0; NodeList nl, nl0;
/*String tmp;
int val;
int[] colors;
String msg = null;
String error = null;
String hash = null;
String id, idvar;
String name;
String command;
String startTime="", finishTime="";
String progression="", nextCommand="";
String transStartTime="", transFinishTime="";
String util = null;
String value;
String extime;
String contdel;
String busname;
String busid;
String state;*/
try { try {
for(int j=0; j<diagramNl.getLength(); j++) { for(int j=0; j<diagramNl.getLength(); j++) {
//System.out.println("Ndes: " + j); //System.out.println("Ndes: " + j);
...@@ -224,19 +208,6 @@ public class DSESimulationResult { ...@@ -224,19 +208,6 @@ public class DSESimulationResult {
loadGlobalConfiguration(node); loadGlobalConfiguration(node);
} }
/*nl = node.getChildNodes();
if ((nl != null) && (nl.getLength() > 0)) {
for(int i=0; i<nl.getLength(); i++) {
node0 = nl.item(i);
TraceManager.addDev("i: " + i + " Node = " + node0);
if (node0.getNodeType() == Node.ELEMENT_NODE) {
// create design, and get an index for it
return loadGlobalConfiguration(node0);
}
}
}*/
} }
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -261,22 +232,11 @@ public class DSESimulationResult { ...@@ -261,22 +232,11 @@ public class DSESimulationResult {
NodeList nl, nl0; NodeList nl, nl0;
String tmp; //int val;
int val;
String id;
int[] colors;
String msg = null;
String error = null;
String hash = null;
String id, idvar;
String name; String name;
String command;
String startTime="", finishTime="";
String progression="", nextCommand="";
String transStartTime="", transFinishTime="";
String util = null; String util = null;
String value;
String extime; String extime;
String contdel; String contdel;
String busname; String busname;
...@@ -304,7 +264,6 @@ public class DSESimulationResult { ...@@ -304,7 +264,6 @@ public class DSESimulationResult {
if (elt.getTagName().compareTo(SIMULATION_CPU) == 0) { if (elt.getTagName().compareTo(SIMULATION_CPU) == 0) {
id = null; id = null;
name = null; name = null;
command = null;
contdel = null; contdel = null;
busname = null; busname = null;
busid = null; busid = null;
...@@ -359,6 +318,77 @@ public class DSESimulationResult { ...@@ -359,6 +318,77 @@ public class DSESimulationResult {
} }
if (elt.getTagName().compareTo(SIMULATION_BUS) == 0) {
name = null;
id = null;
extime = null;
id = elt.getAttribute("id");
name = elt.getAttribute("name");
if ((id != null) && (name != null)) {
nl = elt.getElementsByTagName("util");
if ((nl != null) && (nl.getLength() > 0)) {
node0 = nl.item(0);
//System.out.println("nl:" + nl + " value=" + node0.getNodeValue() + " content=" + node0.getTextContent());
util = node0.getTextContent();
}
if (util != null) {
BusResult busr = new BusResult();
try {
busr.id = Integer.decode(id).intValue();
busr.name = name;
busr.utilization = Double.valueOf(util).doubleValue();
busses.add(busr);
} catch (Exception e) {
}
}
}
}
if (elt.getTagName().compareTo(SIMULATION_TASK) == 0) {
busname = null;
busid = null;
util = null;
extime = null;
state = null;
id = elt.getAttribute("id");
name = elt.getAttribute("name");
if ((id != null) && (name != null)) {
nl = elt.getElementsByTagName("extime");
if ((nl != null) && (nl.getLength() > 0)) {
node0 = nl.item(0);
//System.out.println("nl:" + nl + " value=" + node0.getNodeValue() + " content=" + node0.getTextContent());
extime = node0.getTextContent();
}
nl = elt.getElementsByTagName("tskstate");
if ((nl != null) && (nl.getLength() > 0)) {
node0 = nl.item(0);
//System.out.println("nl:" + nl + " value=" + node0.getNodeValue() + " content=" + node0.getTextContent());
state = node0.getTextContent();
}
if (extime != null) {
TaskResult tr = new TaskResult();
try {
tr.id = Integer.decode(id).intValue();
tr.name = name;
tr.nbOfExecutedCycles = Long.decode(extime).longValue();
tr.state = state;
tasks.add(tr);
} catch (Exception e) {
}
}
}
}
} }
} }
} catch (Exception e) { } catch (Exception e) {
......
/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
ludovic.apvrille AT enst.fr
This software is a computer program whose purpose is to allow the
edition of TURTLE analysis, design and deployment diagrams, to
allow the generation of RT-LOTOS or Java code from this diagram,
and at last to allow the analysis of formal validation traces
obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
from INRIA Rhone-Alpes.
This software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can use,
modify and/ or redistribute the software under the terms of the CeCILL
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited
liability.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms.
/**
* Class TaskResult
* Object for storing a simulation result
* Creation: 07/09/2011
* @version 1.0 07/09/2011
* @author Ludovic APVRILLE
* @see
*/
package dseengine;
import java.io.*;
import java.util.*;
import myutil.*;
//import uppaaldesc.*;
public class TaskResult {
public int id;
public String name;
public long nbOfExecutedCycles;
public String state;
public TaskResult() {
}
} // Class TaskResult
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment