Commit 7f80032f authored by apvrille's avatar apvrille

Update on dse scripts

parent 92052321
# My first DSE script
# Commands are not case sensitive
# To execute this script: java RunDSE -debug script1.dse
#Model
ModelPath = /homes/apvrille/TechTTool/TMLCode/
MappingFile = smartcard.tmap
#Path
PathToSimulator = /homes/apvrille/TechTTool/SystemCCode/generated/
PathToResults = /homes/apvrille/TechTTool/SystemCCode/results/
#Simulation
#Use -1 value to unset
SimulationMaxCycle = -1
SimulationOutputVCD = true
SimulationOutputHTML = true
#SimulationOutputTXT = true
SimulationOutputXML = true
RecordResults = true
SimulationCompilationCommand = make -j9 -C
SimulationExecutionCommand = run.x
SimulationExplorationMinimumCommand = 5
SimulationExplorationMinimumBranch = 5
ShowSimulatorRawOutput = false
NbOfSimulationThreads = 128
#Starting simulation
#runSimulation = 100
#runParallelSimulation = 10000
#runexplo
#runsimulation = 1
#To print in a file all simulation results
#saveAllResults
#To print in a file a summary of simulation results
#saveResultsSummary
#To reset results
#resetResults
#Automatic DSE
TaskModelFile = smartcard.tml
MinNbOfCPUs = 1
MaxNbOfCPUs = 3
MinNbOfCoresPerCPU = 1
MaxNbOfCoresPerCPU = 3
NbOfSimulationsPerMapping = 10
setTap = minSimulationDuration 10
setTap = averageSimulationDuration 0
setTap = maxSimulationDuration 0
setTap = architectureComplexity 1
setTap = averageCPUUsage -10
runDSE
#runParallelDSE
saveAllResults
saveResultsSummary
#End of script
SRCS = generated_src/main.c generated_src/AlarmActuator.c generated_src/PressureSensor.c generated_src/PressureController.c generated_src/MainController.c generated_src/AlarmManager.c generated_src/Timer__alarmTimer__AlarmManager.c
\ No newline at end of file
SRCS = generated_src/main.c generated_src/ResqueTeam.c generated_src/SoftwareOfRoverRobot.c generated_src/RobotWebsite.c generated_src/RobotApplication.c generated_src/Sensors.c
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -71,7 +71,7 @@ public class TMLMapping<E> {
private List<HwCommunicationNode> oncommnodes;
private List<TMLElement> mappedcommelts;
private CorrespondanceTGElement listE;
private CorrespondanceTGElement listE;
// Security
public boolean firewall = false;
......@@ -149,13 +149,13 @@ public class TMLMapping<E> {
return null;
}
public CorrespondanceTGElement getCorrespondanceList(){
return listE;
}
public CorrespondanceTGElement getCorrespondanceList(){
return listE;
}
public void setCorrespondanceList(CorrespondanceTGElement cl){
listE=cl;
}
public void setCorrespondanceList(CorrespondanceTGElement cl){
listE=cl;
}
public void addCustomValue(String custom) {
......@@ -1501,8 +1501,8 @@ public class TMLMapping<E> {
}
}
public boolean channelAllowed(TMLChannel chan){
TMLTask orig = chan.getOriginTask();
public boolean channelAllowed(TMLChannel chan){
TMLTask orig = chan.getOriginTask();
TMLTask dest = chan.getDestinationTask();
List<HwNode> path = getPath(orig, dest);
for (HwNode node:path){
......@@ -1519,10 +1519,10 @@ public class TMLMapping<E> {
}
}
return true;
}
}
public List<HwNode> getPath(TMLTask t1, TMLTask t2){
public List<HwNode> getPath(TMLTask t1, TMLTask t2){
HwNode node1 = getHwNodeOf(t1);
HwNode node2 = getHwNodeOf(t2);
List<HwNode> path = new ArrayList<HwNode>();
......@@ -1576,20 +1576,20 @@ public class TMLMapping<E> {
}
public boolean isAttackerAccessible(TMLChannel chan){
TMLTask orig = chan.getSystemOriginTask();
public boolean isAttackerAccessible(TMLChannel chan){
TMLTask orig = chan.getSystemOriginTask();
TMLTask dest = chan.getSystemDestinationTask();
List<HwNode> path = getPath(orig, dest);
for (HwNode node:path){
if (node instanceof HwBus){
HwBus bus = (HwBus) node;
if (bus.privacy==HwCommunicationNode.BUS_PUBLIC){
return true;
}
}
}
return false;
}
if (node instanceof HwBus){
HwBus bus = (HwBus) node;
if (bus.privacy==HwCommunicationNode.BUS_PUBLIC){
return true;
}
}
}
return false;
}
public String toXML() {
String s = "<TMLMAPPING>\n";
......
......@@ -225,7 +225,7 @@ public class TMLArchiPortArtifact extends TGCWithoutInternalComponent implements
boolean error = false;
// Get the list of all other TMLArchiPortArtifact.java and retrieve the mapped ports
Vector<String> portsList = this.getTDiagramPanel().getMGUI().getAllTMLInputPorts();
Vector<String> portsList = this.getTDiagramPanel().getMGUI().getAllTMLInputPorts();
//TraceManager.addDev( "bufferParameters before opening the window: " + bufferParameters.toString() );
JDialogPortArtifact dialog = new JDialogPortArtifact( frame, "Setting port artifact attributes", this, mappedMemory, portsList, value );
......
......@@ -15,72 +15,72 @@ import fr.tpt.mem4csd.utils.compare.text.TextComparator;
import myutil.FileUtils;
public class TestGTURTLEModeling extends AbstractUITest {
private static final String RESOURCES_DIR = "resources/test/ui/generateccode/";
private final IComparator textComparator;
public TestGTURTLEModeling() {
super();
mainGui.openProjectFromFile( new File( RESOURCES_DIR + "models/ZigBeeTutorial.xml") );
// FIXME: Temporarily ignoring the debug text file due to bug in comparator tool
textComparator = new TextComparator( Collections.singletonList( "txt" ) );
}
private void testGenerateCCode( final String mappingDiagName ) {
final TMLArchiPanel panel = findPanel( mappingDiagName );
final Vector<TGComponent> compos = new Vector<TGComponent>( panel.tmlap.getComponentList() );
assertTrue( mainGui.gtm.checkSyntaxTMLMapping( compos, panel, true ) );
final String codeDir = RESOURCES_DIR + mappingDiagName + File.separator + "actual" + File.separator;
FileUtils.deleteFiles( codeDir );
final String codeDirExpected = RESOURCES_DIR + mappingDiagName + File.separator + "expected" + File.separator;
mainGui.gtm.generateCCode( codeDir );
try {
final IComparisonReport difference = textComparator.compare( new File( codeDir ), new File( codeDirExpected ) );
if ( difference.containsDiff() ) {
difference.print();
fail( "Generated code files are not the same!!!" );
}
else {
FileUtils.deleteFiles( codeDir );
}
}
catch ( final IOException ex ) {
handleException( ex );
}
}
private static final String RESOURCES_DIR = "resources/test/ui/generateccode/";
private final IComparator textComparator;
public TestGTURTLEModeling() {
super();
mainGui.openProjectFromFile( new File( RESOURCES_DIR + "models/ZigBeeTutorial.xml") );
// FIXME: Temporarily ignoring the debug text file due to bug in comparator tool
textComparator = new TextComparator( Collections.singletonList( "txt" ) );
}
private void testGenerateCCode( final String mappingDiagName ) {
final TMLArchiPanel panel = findPanel( mappingDiagName );
final Vector<TGComponent> compos = new Vector<TGComponent>( panel.tmlap.getComponentList() );
assertTrue( mainGui.gtm.checkSyntaxTMLMapping( compos, panel, true ) );
final String codeDir = RESOURCES_DIR + mappingDiagName + File.separator + "actual" + File.separator;
FileUtils.deleteFiles( codeDir );
final String codeDirExpected = RESOURCES_DIR + mappingDiagName + File.separator + "expected" + File.separator;
mainGui.gtm.generateCCode( codeDir );
try {
final IComparisonReport difference = textComparator.compare( new File( codeDir ), new File( codeDirExpected ) );
if ( difference.containsDiff() ) {
difference.print();
fail( "Generated code files are not the same!!!" );
}
else {
FileUtils.deleteFiles( codeDir );
}
}
catch ( final IOException ex ) {
handleException( ex );
}
}
private TMLArchiPanel findPanel( final String name ) {
for ( final TMLArchiPanel panel : mainGui.getTMLArchiDiagramPanels() ) {
if ( name.equals( mainGui.getTitleAt( panel ) ) ) {
return panel;
}
}
return null;
for ( final TMLArchiPanel panel : mainGui.getTMLArchiDiagramPanels() ) {
if ( name.equals( mainGui.getTitleAt( panel ) ) ) {
return panel;
}
}
return null;
}
@Test
public void testGenerateCCodeMapping0() {
testGenerateCCode( "Mapping_0" );
}
testGenerateCCode( "Mapping_0" );
}
@Test
public void testGenerateCCodeMapping1() {
testGenerateCCode( "Mapping_1" );
}
testGenerateCCode( "Mapping_1" );
}
@Test
public void testGenerateCCodeMapping2() {
testGenerateCCode( "Mapping_2" );
}
testGenerateCCode( "Mapping_2" );
}
}
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