diff --git a/src/dseengine/BusContentionResult.java b/src/dseengine/BusContentionResult.java new file mode 100755 index 0000000000000000000000000000000000000000..0c49b3f1cd32489fd759a37912498cbd6f54acc2 --- /dev/null +++ b/src/dseengine/BusContentionResult.java @@ -0,0 +1,71 @@ +/**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 BusContentionResult +* Object for storing a bus contention result after a simulation +* 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 BusContentionResult { + public int id; + public String name; + + public long contention; + + public BusContentionResult() { + } + + + + +} // Class BusResult + diff --git a/src/dseengine/BusResult.java b/src/dseengine/BusResult.java index 951f62d4eb9534c2eec81d5b0b4370d4d7251cf3..0763d5a4b5952dfa101e47c7cfc147d10ebb088a 100755 --- a/src/dseengine/BusResult.java +++ b/src/dseengine/BusResult.java @@ -57,7 +57,7 @@ import myutil.*; public class BusResult { public int id; - private String name; + public String name; public double utilization; diff --git a/src/dseengine/CPUResult.java b/src/dseengine/CPUResult.java index 2dbd0f1f2512735ab473c9794c4a76d3a49ce585..c58eb7ff3ca42a5ea74ca6ef96c7ba2096d954d9 100755 --- a/src/dseengine/CPUResult.java +++ b/src/dseengine/CPUResult.java @@ -57,15 +57,22 @@ import myutil.*; public class CPUResult { public int id; - private String name; + public String name; public double utilization; + public vector<BusContentionResult> contentions; + public CPUResult() { } - - + public addContentionOnBus(BusContentionResult ct) { + if (contentions == null) { + contentions = new vector<BusContentionResult>(); + } + + contentions.add(ct); + } } // Class BusResult diff --git a/src/dseengine/DSESimulationResult.java b/src/dseengine/DSESimulationResult.java index 277b53ad3338ce9b905e44b29ffbbc640effd632..3fc9ab9b431bbe30d3ae4b0cfbc3f8b529118431 100755 --- a/src/dseengine/DSESimulationResult.java +++ b/src/dseengine/DSESimulationResult.java @@ -302,7 +302,60 @@ public class DSESimulationResult { // Status if (elt.getTagName().compareTo(SIMULATION_CPU) == 0) { + id = null; + name = null; + command = null; + contdel = null; + busname = null; + busid = null; + util = 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(); + } + + //System.out.println("toto12"); + nl = elt.getElementsByTagName("contdel"); + if ((nl != null) && (nl.getLength() > 0)) { + nl = elt.getElementsByTagName("contdel"); + node0 = nl.item(0); + elt0 = (Element)node0; + busid = elt0.getAttribute("busID"); + busname = elt0.getAttribute("busName"); + //System.out.println("nl:" + nl + " value=" + node0.getNodeValue() + " content=" + node0.getTextContent()); + contdel = node0.getTextContent(); + } + + if ((util != null) || ((contdel != null) && (busid != null) && (busname != null))) { + CPUResult cpur = new CPUResult(); + try { + cpur.id = Integer.decode(id).intValue(); + cpur.name = name; + + if (util != null) { + cpur.util = Double.valueOf(util).doubleValue(); + } + + if ((contdel != null) && (busid != null) && (busname != null)) { + BusContentionResult bcr = new BusContentionResult(); + bcr.id = Integer.decode(busid).intValue(); + bcr.name = busname; + bcr.contention = Long.decode(contdel).longValue(); + cpur.addContentionOnBus(bcr); + } + + cpus.add(cpur); + } catch (Exception e) { + } + } + } }