Commit 489079e6 authored by Rakshit Mittal's avatar Rakshit Mittal
Browse files

updated test

parent f3bb5fe5
--
-- AADL-RAMSES
--
-- Copyright © 2012 TELECOM ParisTech and CNRS
--
-- TELECOM ParisTech/LTCI
--
-- Authors: see AUTHORS
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the Eclipse Public License as published by Eclipse,
-- either version 1.0 of the License, or (at your option) any later version.
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- Eclipse Public License for more details.
-- You should have received a copy of the Eclipse Public License
-- along with this program. If not, see
-- http://www.eclipse.org/org/documents/epl-v10.php
--
package dim_test_mcdag_state
public
with RAMSES_properties, Data_Model;
system main
end main;
system implementation main.impl
subcomponents
cpu: system multicore.impl;
proc: process proc.impl;
connections
tfe_cnx: port cpu.timing_failure_event -> proc.tfe;
rec_cnx: port cpu.hyperperiod -> proc.recovery;
properties
Deadline => 1600ms applies to proc;
Actual_Processor_Binding => (reference (cpu)) applies to proc;
Actual_Memory_Binding => (reference (cpu.internal_memory)) applies to proc;
-- Property associations below must be generated by the MxC-DAG scheduling method
RAMSES_properties::Execution_Slots => (
[Computation_Unit => reference (cpu.core1); Start_Time => 0ms; End_Time => 300ms;]
) in modes (LO), (
[Computation_Unit => reference (cpu.core1); Start_Time => 0ms; End_Time => 300ms;]
) in modes (HI) applies to proc.tg_phase1.Avoid;
RAMSES_properties::Execution_Slots => (
[Computation_Unit => reference (cpu.core1); Start_Time => 300ms; End_Time => 900ms;]
) in modes (LO), (
[Computation_Unit => reference (cpu.core1); Start_Time => 300ms; End_Time => 1100ms;]
) in modes (HI) applies to proc.tg_phase1.Nav;
RAMSES_properties::Execution_Slots => (
[Computation_Unit => reference (cpu.core1); Start_Time => 900ms; End_Time => 1100ms;]
) in modes (LO), (
[Computation_Unit => reference (cpu.core1); Start_Time => 1100ms; End_Time => 1600ms;]
) in modes (HI) applies to proc.tg_phase1.Stab;
RAMSES_properties::Execution_Slots => (
[Computation_Unit => reference (cpu.core1); Start_Time => 1100ms; End_Time => 1300ms;]
) in modes (LO) applies to proc.tg_phase1.Log;
RAMSES_properties::Execution_Slots => (
[Computation_Unit => reference (cpu.core1); Start_Time => 1300ms; End_Time => 1600ms;]
) in modes (LO) applies to proc.tg_phase1.Com;
RAMSES_properties::Execution_Slots => (
[Computation_Unit => reference (cpu.core2); Start_Time => 0ms; End_Time => 600ms;]
) in modes (LO) applies to proc.tg_phase1.Video;
RAMSES_properties::Execution_Slots => (
[Computation_Unit => reference (cpu.core2); Start_Time => 600ms; End_Time => 800ms;]
) in modes (LO) applies to proc.tg_phase1.GPS;
RAMSES_properties::Execution_Slots => (
[Computation_Unit => reference (cpu.core2); Start_Time => 800ms; End_Time => 1000ms;]
) in modes (LO) applies to proc.tg_phase1.Rec;
Frame_Period => 1600ms applies to cpu.core1;
Frame_Period => 1600ms applies to cpu.core2;
end main.impl;
system multicore
features
timing_failure_event: out event port;
hyperperiod: out event port;
end multicore;
system implementation multicore.impl
subcomponents
core1: processor cpu;
core2: processor cpu;
internal_memory: memory mem;
properties
RAMSES_properties::Is_Processor => true;
Scheduling_Protocol => (static);
end multicore.impl;
memory mem
end mem;
processor cpu
end cpu;
process proc
features
tfe: in event port;
recovery: in event port;
to_phase1: in event port;
end proc;
data position extends Integer
end position;
data speed extends Integer
end speed;
data obstacle extends Integer
end obstacle;
data info extends Integer
end info;
data engine_cmd extends Integer
end engine_cmd;
thread Nav_thread extends HI_thread
features
obst_in: in data port obstacle;
speed_out: out data port speed;
end Nav_thread;
thread implementation Nav_thread.impl extends HI_thread.impl
calls
nav_seq: {
nav_c: subprogram nav;
};
end Nav_thread.impl;
thread Stab_thread extends HI_thread
features
speed_in: in data port speed;
cmd_out: out data port engine_cmd;
end Stab_thread;
thread implementation Stab_thread.impl extends HI_thread.impl
calls
stab_seq: {
stab_c: subprogram stab;
};
end Stab_thread.impl;
thread Avoid_thread extends HI_thread
features
obst_out: out data port obstacle;
end Avoid_thread;
thread implementation Avoid_thread.impl extends HI_thread.impl
calls
avoid_seq: {
avoid_c: subprogram avoid;
};
end Avoid_thread.impl;
thread Log_thread extends LO_thread
features
obst_in: in data port obstacle;
speed_in: in data port speed;
cmd_in: in data port engine_cmd;
info_out: out data port info;
end Log_thread;
thread implementation Log_thread.impl extends LO_thread.impl
calls
log_seq: {
log_c: subprogram log;
};
end Log_thread.impl;
thread Com_thread extends LO_thread
features
info_in: in data port info;
end Com_thread;
thread implementation Com_thread.impl extends LO_thread.impl
calls
com_seq: {
com_c: subprogram com;
};
end Com_thread.impl;
thread Video_thread extends LO_thread
end Video_thread;
thread implementation Video_thread.impl extends LO_thread.impl
calls
video_seq: {
video_c: subprogram video;
};
end Video_thread.impl;
thread GPS_thread extends LO_thread
features
pos_out: out data port position;
end GPS_thread;
thread implementation GPS_thread.impl extends LO_thread.impl
calls
gps_seq: {
gps_c: subprogram gps;
};
end GPS_thread.impl;
thread Rec_thread extends LO_thread
features
pos_in: in data port position;
end Rec_thread;
thread implementation Rec_thread.impl extends LO_thread.impl
calls
rec_seq: {
rec_c: subprogram rec;
};
end Rec_thread.impl;
-- DAG: Taches de priodes identiques dans le meme process interconnectees par connections immediates
--
thread group threads
features
tfe: in event port;
recovery: in event port;
modes
LO: initial mode;
HI: mode;
LOtoHI: LO -[tfe]-> HI {Mode_Transition_Response => emergency;};
HItoLO: HI -[recovery]-> LO {Mode_Transition_Response => planned;};
end threads;
thread group implementation threads.phase_1
subcomponents
Nav: thread Nav_thread.impl {
Period => 1600ms;
Compute_Entrypoint_Call_Sequence => reference (nav_seq);
Compute_Execution_Time => 600ms .. 600ms in modes (LO), 800ms .. 800ms in modes (HI);
} in modes (LO => LO, HI => HI);
Stab: thread Stab_thread.impl {
Period => 1600ms;
Compute_Entrypoint_Call_Sequence => reference (stab_seq);
Compute_Execution_Time => 200ms .. 200ms in modes (LO), 500ms .. 500ms in modes (HI);
} in modes (LO => LO, HI => HI);
Avoid: thread Avoid_thread.impl {
Period => 1600ms;
Compute_Entrypoint_Call_Sequence => reference (avoid_seq);
Compute_Execution_Time => 300ms .. 300ms in modes (LO), 300ms .. 300ms in modes (HI);
} in modes (LO => LO, HI => HI);
Log: thread Log_thread.impl {
Period => 1600ms;
Compute_Entrypoint_Call_Sequence => reference (log_seq);
Compute_Execution_Time => 200ms .. 200ms in modes (LO);
RAMSES_properties::Weakly_Hard_Real_Time_Constraint => [Timing_Failure_Limit => 1; In_Frame => 2;];
} in modes (LO => LO);
Com: thread Com_thread.impl {
Period => 1600ms;
Compute_Entrypoint_Call_Sequence => reference (com_seq);
Compute_Execution_Time => 300ms .. 300ms in modes (LO);
} in modes (LO => LO);
Video: thread Video_thread.impl {
Period => 1600ms;
Compute_Entrypoint_Call_Sequence => reference (video_seq);
Compute_Execution_Time => 600ms .. 600ms in modes (LO);
} in modes (LO => LO);
GPS: thread GPS_thread.impl {
Period => 1600ms;
Compute_Entrypoint_Call_Sequence => reference (gps_seq);
Compute_Execution_Time => 200ms .. 200ms in modes (LO);
} in modes (LO => LO);
Rec: thread Rec_thread.impl {
Period => 1600ms;
Compute_Entrypoint_Call_Sequence => reference (rec_seq);
Compute_Execution_Time => 200ms .. 200ms in modes (LO);
} in modes (LO => LO);
connections
cnx1: port Avoid.obst_out -> Nav.obst_in;
cnx2: port Avoid.obst_out -> Log.obst_in;
cnx3: port Nav.speed_out -> Stab.speed_in;
cnx4: port Nav.speed_out -> Log.speed_in;
cnx5: port Stab.cmd_out -> Log.cmd_in;
cnx6: port Log.info_out -> Com.info_in;
cnx7: port GPS.pos_out -> Rec.pos_in;
properties
Timing => immediate applies to cnx1, cnx2, cnx3, cnx4, cnx5, cnx6, cnx7;
end threads.phase_1;
process implementation proc.impl
subcomponents
tg_phase1: thread group threads.phase_1;
connections
conn_tfe: port tfe -> tg_phase1.tfe;
conn_rec: port recovery -> tg_phase1.recovery;
end proc.impl;
thread periodic_thread
properties
Dispatch_Protocol => periodic;
Priority => 1;
end periodic_thread;
thread LO_thread extends periodic_thread
requires modes
LO: mode;
properties
Criticality => 2;
end LO_thread;
thread HI_thread extends periodic_thread
requires modes
LO: mode;
HI: mode;
properties
Criticality => 4;
end HI_thread;
thread implementation periodic_thread.impl
-- calls
-- nav_seq: {
-- nav_c: subprogram nav;
-- };
-- avoid_seq: {
-- avoid_c: subprogram avoid;
-- };
-- stab_seq: {
-- stab_c: subprogram stab;
-- };
-- log_seq: {
-- log_c: subprogram log;
-- };
-- com_seq: {
-- com_c: subprogram com;
-- };
-- video_seq: {
-- video_c: subprogram video;
-- };
-- gps_seq: {
-- gps_c: subprogram gps;
-- };
-- rec_seq: {
-- rec_c: subprogram rec;
-- };
end periodic_thread.impl;
thread implementation HI_thread.impl extends periodic_thread.impl
end HI_thread.impl;
thread implementation LO_thread.impl extends periodic_thread.impl
end LO_thread.impl;
subprogram user_code
properties
source_language => (C);
source_text => ("user_code.h", "user_code.c");
end user_code;
subprogram Nav extends user_code
properties
source_name => "nav";
end Nav;
subprogram Stab extends user_code
properties
source_name => "stab";
end Stab;
subprogram Avoid extends user_code
properties
source_name => "avoid";
end Avoid;
subprogram Log extends user_code
properties
source_name => "log";
end Log;
subprogram Com extends user_code
properties
source_name => "com";
end Com;
subprogram Video extends user_code
properties
source_name => "video";
end Video;
subprogram GPS extends user_code
properties
source_name => "gps";
end GPS;
subprogram Rec extends user_code
properties
source_name => "rec";
end Rec;
data Integer
properties
Data_Model::Data_Representation => integer;
end Integer;
end dim_test_mcdag_state;
\ No newline at end of file
......@@ -2,11 +2,9 @@ package fr.mem4csd.osatedim.tests;
import java.io.IOException;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.junit.jupiter.api.Test;
import org.osate.aadl2.AadlPackage;
import org.osate.aadl2.modelsupport.FileNameConstants;
import fr.mem4csd.osatedim.ui.utils.DeinstantiationUtils;
import fr.mem4csd.osatedim.viatra.preference.DIMPreferences;
import fr.mem4csd.osatedim.viatra.utils.PackageUtils;
......@@ -24,7 +22,7 @@ public class TestState extends TestAbstract {
protected static void prepareTestStateResources(String inputModelName) {
ResourceSet resSet = prepareTestResources(inputModelName);
Resource ramsesResource = resSet.getResource(topSystemInst.eResource().getURI().trimSegments(4).appendSegment( "RAMSES" ).appendFileExtension( FileNameConstants.SOURCE_FILE_EXT ), true );
//Resource ramsesResource = resSet.getResource(topSystemInst.eResource().getURI().trimSegments(4).appendSegment( "RAMSES" ).appendFileExtension( FileNameConstants.SOURCE_FILE_EXT ), true );
final URI declarativeModelUri = DeinstantiationUtils.computeDeclarativeUri(aaxlResource.getURI(), topSystemInst);
aadlResource = resSet.createResource(declarativeModelUri);
}
......
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