Skip to content
Snippets Groups Projects
Commit 14a463ad authored by apvrille's avatar apvrille
Browse files

Update on dse management

parent dc9504b2
No related branches found
No related tags found
No related merge requests found
Showing with 440 additions and 419 deletions
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<SystemCCodeCompileCommand data="make" /> <SystemCCodeCompileCommand data="make" />
<SystemCCodeExecuteCommand data="../simulators/c++2/run.x -ovcd ../simulators/c++2/vcddump.vcd" /> <SystemCCodeExecuteCommand data="../simulators/c++2/run.x -ovcd ../simulators/c++2/vcddump.vcd" />
<SystemCCodeInteractiveExecuteCommand data="../simulators/c++2/run.x -server" /> <SystemCCodeInteractiveExecuteCommand data="../simulators/c++2/run.x -server" />
<TMLCodeDirectory data="../tmlcode" /> <TMLCodeDirectory data="../tmlcode/" />
<GTKWavePath data="/usr/bin/gtkwave" /> <GTKWavePath data="/usr/bin/gtkwave" />
<VCDPath data="../vcd/" /> <VCDPath data="../vcd/" />
<UPPAALCodeDirectory data="../uppaal/" /> <UPPAALCodeDirectory data="../uppaal/" />
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<SystemCCodeCompileCommand data="make" /> <SystemCCodeCompileCommand data="make" />
<SystemCCodeExecuteCommand data="../simulators/c++2/run.x -ovcd ../simulators/c++2/vcddump.vcd" /> <SystemCCodeExecuteCommand data="../simulators/c++2/run.x -ovcd ../simulators/c++2/vcddump.vcd" />
<SystemCCodeInteractiveExecuteCommand data="../simulators/c++2/run.x -server" /> <SystemCCodeInteractiveExecuteCommand data="../simulators/c++2/run.x -server" />
<TMLCodeDirectory data="../tmlcode" /> <TMLCodeDirectory data="../tmlcode/" />
<GTKWavePath data="/usr/bin/gtkwave" /> <GTKWavePath data="/usr/bin/gtkwave" />
<VCDPath data="../vcd/" /> <VCDPath data="../vcd/" />
<UPPAALCodeDirectory data="../uppaal/" /> <UPPAALCodeDirectory data="../uppaal/" />
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<SystemCCodeCompileCommand data="make" /> <SystemCCodeCompileCommand data="make" />
<SystemCCodeExecuteCommand data="../simulators/c++2/run.x -ovcd ../simulators/c++2/vcddump.vcd" /> <SystemCCodeExecuteCommand data="../simulators/c++2/run.x -ovcd ../simulators/c++2/vcddump.vcd" />
<SystemCCodeInteractiveExecuteCommand data="../simulators/c++2/run.x -server" /> <SystemCCodeInteractiveExecuteCommand data="../simulators/c++2/run.x -server" />
<TMLCodeDirectory data="../tmlcode" /> <TMLCodeDirectory data="../tmlcode/" />
<GTKWavePath data="/usr/bin/gtkwave" /> <GTKWavePath data="/usr/bin/gtkwave" />
<VCDPath data="../vcd/" /> <VCDPath data="../vcd/" />
<UPPAALCodeDirectory data="../uppaal/" /> <UPPAALCodeDirectory data="../uppaal/" />
......
File deleted
File deleted
This diff is collapsed.
...@@ -13,8 +13,8 @@ dependencies { ...@@ -13,8 +13,8 @@ dependencies {
compileOnly name: 'opencloud' compileOnly name: 'opencloud'
compileOnly name: 'JavaPlot' compileOnly name: 'JavaPlot'
compileOnly name: 'derbynet' compileOnly name: 'derbynet'
compileOnly name: 'commons-math3-3.6.1'
compileOnly name: 'commons-codec-1.10' compileOnly name: 'commons-codec-1.10'
compileOnly name: 'commons-io-2.5-javadoc'
compileOnly name: 'commons-io-2.5' compileOnly name: 'commons-io-2.5'
compileOnly name: 'jsoup-1.8.1' compileOnly name: 'jsoup-1.8.1'
compileOnly name: 'gs-core-1.3' compileOnly name: 'gs-core-1.3'
......
...@@ -94,23 +94,23 @@ public class CPUWholeResult { ...@@ -94,23 +94,23 @@ public class CPUWholeResult {
BusContentionWholeResult bcwr; BusContentionWholeResult bcwr;
if (rescpu.contentions != null) { if (rescpu.contentions != null) {
TraceManager.addDev("Working on contentions"); //TraceManager.addDev("Working on contentions");
for(BusContentionResult ct: rescpu.contentions) { for(BusContentionResult ct: rescpu.contentions) {
TraceManager.addDev("One contention"); //TraceManager.addDev("One contention");
o = contentionTable.get(ct.id); o = contentionTable.get(ct.id);
if (o == null) { if (o == null) {
bcwr = new BusContentionWholeResult(ct); bcwr = new BusContentionWholeResult(ct);
contentionTable.put(ct.id, bcwr); contentionTable.put(ct.id, bcwr);
addContentionOnBus(bcwr); addContentionOnBus(bcwr);
TraceManager.addDev("adding contention"); //TraceManager.addDev("adding contention");
} else { } else {
bcwr = (BusContentionWholeResult)o; bcwr = (BusContentionWholeResult)o;
bcwr.updateResults(ct); bcwr.updateResults(ct);
TraceManager.addDev("updating contention"); //TraceManager.addDev("updating contention");
} }
} }
} else { } else {
TraceManager.addDev("null contention"); //TraceManager.addDev("null contention");
} }
} }
...@@ -138,7 +138,7 @@ public class CPUWholeResult { ...@@ -138,7 +138,7 @@ public class CPUWholeResult {
double average = 0; double average = 0;
if (contentions == null) { if (contentions == null) {
TraceManager.addDev("No contention"); //TraceManager.addDev("No contention");
return 0; return 0;
} }
...@@ -153,7 +153,7 @@ public class CPUWholeResult { ...@@ -153,7 +153,7 @@ public class CPUWholeResult {
long max = 0; long max = 0;
if (contentions == null) { if (contentions == null) {
TraceManager.addDev("No contention"); //TraceManager.addDev("No contention");
return 0; return 0;
} }
...@@ -168,7 +168,7 @@ public class CPUWholeResult { ...@@ -168,7 +168,7 @@ public class CPUWholeResult {
long min = 10000000; long min = 10000000;
if (contentions == null) { if (contentions == null) {
TraceManager.addDev("No contention"); //TraceManager.addDev("No contention");
return 0; return 0;
} }
......
...@@ -62,6 +62,7 @@ import java.io.File; ...@@ -62,6 +62,7 @@ import java.io.File;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.*; import java.util.*;
import java.util.List; import java.util.List;
import org.apache.commons.math3.util.CombinatoricsUtils;
//import tmltranslator.touppaal.*; //import tmltranslator.touppaal.*;
//import tmltranslator.tomappingsystemc.*; //import tmltranslator.tomappingsystemc.*;
...@@ -145,7 +146,7 @@ public class DSEConfiguration implements Runnable { ...@@ -145,7 +146,7 @@ public class DSEConfiguration implements Runnable {
private int minNbOfCPUs = 1; private int minNbOfCPUs = 1;
private int maxNbOfCPUs = 2; private int maxNbOfCPUs = 2;
private int minNbOfCoresPerCPU = 1; private int minNbOfCoresPerCPU = 1;
private int maxNbOfCoresPerCPU = 2; private int maxNbOfCoresPerCPU = 1;
private int nbOfSimulationsPerMapping = 1; private int nbOfSimulationsPerMapping = 1;
private TMLModeling<TGComponent> taskModel = null; private TMLModeling<TGComponent> taskModel = null;
// private TMLModeling secModel = null; // private TMLModeling secModel = null;
...@@ -1128,7 +1129,7 @@ public class DSEConfiguration implements Runnable { ...@@ -1128,7 +1129,7 @@ public class DSEConfiguration implements Runnable {
rankMappings(dsemapresults); rankMappings(dsemapresults);
sb.append("\nGrades: (Mapping#, grade)\n"); //sb.append("\nGrades: (Mapping#, grade)\n");
int[] grades = dsemapresults.getGrades().clone(); int[] grades = dsemapresults.getGrades().clone();
int j; int j;
for(j=0; j<grades.length; j++) { for(j=0; j<grades.length; j++) {
...@@ -1136,24 +1137,24 @@ public class DSEConfiguration implements Runnable { ...@@ -1136,24 +1137,24 @@ public class DSEConfiguration implements Runnable {
} }
sb.append("\n"); sb.append("\n");
TraceManager.addDev("Ranking"); //TraceManager.addDev("Ranking");
sb.append("\nRanking (Rank, mapping, grade)\n"); sb.append("\nRanking (Rank, mapping, grade)\n");
int[] index = new int[grades.length]; int[] index = new int[grades.length];
for(j=0; j<grades.length; j++) { for(j=0; j<grades.length; j++) {
index[j] = j; index[j] = j;
} }
TraceManager.addDev("Ranking 0"); //TraceManager.addDev("Ranking 0");
Conversion.quickSort(grades, 0, grades.length-1, index); Conversion.quickSort(grades, 0, grades.length-1, index);
TraceManager.addDev("Ranking 1"); //TraceManager.addDev("Ranking 1");
for(j=grades.length-1; j>=0; j--) { for(j=grades.length-1; j>=0; j--) {
sb.append("(#" + (grades.length-j) + ", " + index[j] + ", " + grades[j]+ ") "); sb.append("(#" + (grades.length-j) + ", " + index[j] + ", " + grades[j]+ ") ");
} }
TraceManager.addDev("Ranking done"); //TraceManager.addDev("Ranking done");
try { try {
...@@ -1323,7 +1324,10 @@ public class DSEConfiguration implements Runnable { ...@@ -1323,7 +1324,10 @@ public class DSEConfiguration implements Runnable {
return -1; return -1;
} }
TraceManager.addDev("Task model loaded"); TraceManager.addDev("runDSE. Going to give info on CPUs and mappings");
TraceManager.addDev("runDSE. Task model loaded. Nb of cpus=" + minNbOfCPUs + "-> " + maxNbOfCPUs);
mappings = generateAllMappings(taskModel); mappings = generateAllMappings(taskModel);
...@@ -1603,6 +1607,16 @@ public class DSEConfiguration implements Runnable { ...@@ -1603,6 +1607,16 @@ public class DSEConfiguration implements Runnable {
return 0; return 0;
} }
public long getNbOfPossibleMappings(TMLModeling tl) {
long nb = 0;
int nbOfTasks = tl.getTasks().size();
for (int i=minNbOfCPUs; i<=maxNbOfCPUs; i++) {
nb += CombinatoricsUtils.stirlingS2(nbOfTasks, i);
}
return nb;
}
public Vector<TMLMapping<TGComponent>> generateAllMappings(TMLModeling<TGComponent> _tmlm) { public Vector<TMLMapping<TGComponent>> generateAllMappings(TMLModeling<TGComponent> _tmlm) {
TraceManager.addDev("Generate all mappings"); TraceManager.addDev("Generate all mappings");
if (_tmlm == null) { if (_tmlm == null) {
...@@ -1618,13 +1632,17 @@ public class DSEConfiguration implements Runnable { ...@@ -1618,13 +1632,17 @@ public class DSEConfiguration implements Runnable {
return null; return null;
} }
int min = Math.max(1, minNbOfCPUs); int min = Math.max(1, minNbOfCPUs);
int max = Math.min(nbOfTasks, maxNbOfCPUs); int max = Math.min(nbOfTasks, maxNbOfCPUs);
if (max <= min) { if (max < min) {
max = min + 1; max = min + 1;
} }
TraceManager.addDev("runDSE. Task model loaded. Nb of possible mappings:" + getNbOfPossibleMappings(_tmlm));
Vector<TMLMapping<TGComponent>> maps = new Vector<>(); Vector<TMLMapping<TGComponent>> maps = new Vector<>();
for(int cpt=min; cpt<=max; cpt++) { for(int cpt=min; cpt<=max; cpt++) {
...@@ -1696,6 +1714,7 @@ public class DSEConfiguration implements Runnable { ...@@ -1696,6 +1714,7 @@ public class DSEConfiguration implements Runnable {
private void computeMappings(Vector<TMLTask> remainingTasks, CPUWithTasks[] cpus_tasks, Vector<TMLMapping<TGComponent>> maps, TMLModeling<TGComponent> _tmlm) { private void computeMappings(Vector<TMLTask> remainingTasks, CPUWithTasks[] cpus_tasks, Vector<TMLMapping<TGComponent>> maps, TMLModeling<TGComponent> _tmlm) {
if (remainingTasks.size() == 0) { if (remainingTasks.size() == 0) {
// Can generate the mapping from cpus_tasks // Can generate the mapping from cpus_tasks
TraceManager.addDev("Making mapping");
makeMapping(cpus_tasks, maps, _tmlm); makeMapping(cpus_tasks, maps, _tmlm);
return; return;
} }
...@@ -1708,9 +1727,9 @@ public class DSEConfiguration implements Runnable { ...@@ -1708,9 +1727,9 @@ public class DSEConfiguration implements Runnable {
TraceManager.addDev("Mapping task: " + t.getName()); TraceManager.addDev("Mapping task: " + t.getName());
// Two solutions: either it is mapped on the first free CPU, or it is mapped on an already occupied CPU // Two solutions: either it is mapped on the first free CPU, or it is mapped on an already occupied CPU
// Memo: all cpus must have at least on task at the end // Memo: all cpus must have at least one task at the end
// Must it be mapped a free CPU? // Must it be mapped to a free CPU?
if (nbOfFreeCPUs(cpus_tasks) >= (remainingTasks.size()+1)) { if (nbOfFreeCPUs(cpus_tasks) >= (remainingTasks.size()+1)) {
// The task must be mapped on a free CPU // The task must be mapped on a free CPU
// Search for the first free CPU // Search for the first free CPU
...@@ -1727,7 +1746,7 @@ public class DSEConfiguration implements Runnable { ...@@ -1727,7 +1746,7 @@ public class DSEConfiguration implements Runnable {
TraceManager.addDev("Task could not be mapped on a free CPU: " + t.getName()); TraceManager.addDev("Task could not be mapped on a free CPU: " + t.getName());
} }
TraceManager.addDev("Regular mapping of: " + t.getName()); TraceManager.addDev("Regular mapping of: " + t.getName() + " length=" + cpus_tasks.length);
// It can be mapped on whatever CPU, until the first free one has been met (the first free CPU is inclusive) // It can be mapped on whatever CPU, until the first free one has been met (the first free CPU is inclusive)
remainingTasks.remove(t); remainingTasks.remove(t);
for(int i=0; i<cpus_tasks.length; i++) { for(int i=0; i<cpus_tasks.length; i++) {
......
...@@ -404,17 +404,17 @@ public class TMLArchitecture { ...@@ -404,17 +404,17 @@ public class TMLArchitecture {
if (node instanceof HwCPU) { if (node instanceof HwCPU) {
HwCPU cpu = (HwCPU)node; HwCPU cpu = (HwCPU)node;
complexity += cpu.nbOfCores * cpu.byteDataSize * cpu.pipelineSize; complexity += cpu.nbOfCores * cpu.byteDataSize * cpu.pipelineSize;
TraceManager.addDev("complexity CPU= " + complexity); //TraceManager.addDev("complexity CPU= " + complexity);
} }
if (node instanceof HwBus) { if (node instanceof HwBus) {
HwBus bus = (HwBus)node; HwBus bus = (HwBus)node;
complexity += bus.byteDataSize * bus.pipelineSize; 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; return complexity;
} }
......
...@@ -61,9 +61,9 @@ public class TMLPort extends TMLElement { ...@@ -61,9 +61,9 @@ public class TMLPort extends TMLElement {
private String dataFlowType; private String dataFlowType;
public TMLPort( String _name, Object _referenceObject ) { public TMLPort( String _name, Object _referenceObject ) {
super( _name, _referenceObject ); super( _name, _referenceObject );
dataFlowType = ( (TMLCPrimitivePort)referenceObject ).getDataFlowType(); if (referenceObject instanceof TMLCPrimitivePort)
dataFlowType = ( (TMLCPrimitivePort)referenceObject ).getDataFlowType();
} }
......
...@@ -764,10 +764,14 @@ public class JDialogDSE extends JDialog implements ActionListener, ListSelection ...@@ -764,10 +764,14 @@ public class JDialogDSE extends JDialog implements ActionListener, ListSelection
output+="Simulation execution error \n"; output+="Simulation execution error \n";
return; return;
} }
TraceManager.addDev("Setting min nb of CPUs to:" + NbMinCPU);
if (config.setMinNbOfCPUs(NbMinCPU) != 0) { if (config.setMinNbOfCPUs(NbMinCPU) != 0) {
TraceManager.addDev("Can't set Min # CPUS to " + NbMinCPU); TraceManager.addDev("Can't set Min # CPUS to " + NbMinCPU);
output+="Can't set Min # CPUS to " + NbMinCPU+"\n"; output+="Can't set Min # CPUS to " + NbMinCPU+"\n";
} }
TraceManager.addDev("Setting max nb of CPUs to:" + NbMaxCPU);
if (config.setMaxNbOfCPUs(NbMaxCPU) != 0) { if (config.setMaxNbOfCPUs(NbMaxCPU) != 0) {
TraceManager.addDev("Can't set Max # CPUS to " + NbMaxCPU); TraceManager.addDev("Can't set Max # CPUS to " + NbMaxCPU);
output+="Can't set Max # CPUS to " + NbMaxCPU +"\n"; output+="Can't set Max # CPUS to " + NbMaxCPU +"\n";
...@@ -804,12 +808,12 @@ public class JDialogDSE extends JDialog implements ActionListener, ListSelection ...@@ -804,12 +808,12 @@ public class JDialogDSE extends JDialog implements ActionListener, ListSelection
TraceManager.addDev("Can't print all results"); TraceManager.addDev("Can't print all results");
output+="Can't print all results \n"; output+="Can't print all results \n";
} }
System.out.println("Results printed"); //System.out.println("Results printed");
if (config.printResultsSummary("", true, true)!=0){ if (config.printResultsSummary("", true, true)!=0){
TraceManager.addDev("Can't print result summary"); TraceManager.addDev("Can't print result summary");
output+="Can't print result summary \n"; output+="Can't print result summary \n";
} }
System.out.println("Results summary printed"); //System.out.println("Results summary printed");
jp1.setSelectedIndex(1); jp1.setSelectedIndex(1);
outputText.setText(output + "\n" + config.overallResults); outputText.setText(output + "\n" + config.overallResults);
} }
...@@ -824,7 +828,7 @@ public class JDialogDSE extends JDialog implements ActionListener, ListSelection ...@@ -824,7 +828,7 @@ public class JDialogDSE extends JDialog implements ActionListener, ListSelection
if (config.replaceTapValues(tap)<0){ if (config.replaceTapValues(tap)<0){
output+="Error changing values"; output+="Error changing values";
} }
System.out.println(tap[0]); //System.out.println(tap[0]);
if (config.printResultsSummary("", true, true)!=0){ if (config.printResultsSummary("", true, true)!=0){
TraceManager.addDev("Can't print result summary"); TraceManager.addDev("Can't print result summary");
output+="Can't print result summary \n"; output+="Can't print result summary \n";
......
...@@ -23,7 +23,7 @@ dependencies { ...@@ -23,7 +23,7 @@ dependencies {
compile name: 'JavaPlot' compile name: 'JavaPlot'
compile name: 'derbynet' compile name: 'derbynet'
compile name: 'commons-codec-1.10' compile name: 'commons-codec-1.10'
compile name: 'commons-io-2.5-javadoc' compile name: 'commons-math3-3.6.1'
compile name: 'commons-io-2.5' compile name: 'commons-io-2.5'
compile name: 'jsoup-1.8.1' compile name: 'jsoup-1.8.1'
compile name: 'gs-core-1.3' compile name: 'gs-core-1.3'
......
...@@ -15,7 +15,6 @@ dependencies { ...@@ -15,7 +15,6 @@ dependencies {
compileOnly name: 'commons-codec-1.10' compileOnly name: 'commons-codec-1.10'
compileOnly name: 'jsoup-1.8.1' compileOnly name: 'jsoup-1.8.1'
compileOnly name: 'commons-io-2.5' compileOnly name: 'commons-io-2.5'
compileOnly name: 'commons-io-2.5-javadoc'
compileOnly name: 'derbyclient-10.9.1.0' compileOnly name: 'derbyclient-10.9.1.0'
compileOnly name: 'derbynet' compileOnly name: 'derbynet'
compileOnly name: 'dom4j-1.6.1' compileOnly name: 'dom4j-1.6.1'
......
...@@ -15,7 +15,6 @@ dependencies { ...@@ -15,7 +15,6 @@ dependencies {
compileOnly name: 'commons-codec-1.10' compileOnly name: 'commons-codec-1.10'
compileOnly name: 'jsoup-1.8.1' compileOnly name: 'jsoup-1.8.1'
compile name: 'commons-io-2.5' compile name: 'commons-io-2.5'
compile name: 'commons-io-2.5-javadoc'
compile name: 'derbyclient-10.9.1.0' compile name: 'derbyclient-10.9.1.0'
compile name: 'derbynet' compile name: 'derbynet'
compile name: 'dom4j-1.6.1' compile name: 'dom4j-1.6.1'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment