Commit 19daf9d1 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add test case

parent b3150efc
......@@ -74,6 +74,9 @@ package body TASTE.AADL_Parser is
File_Descr := Ocarina.Files.Load_File (File_Name);
Interface_Root := Ocarina.Parser.Parse (AADL_Language,
Interface_Root, File_Descr);
if Interface_Root = No_Node then
raise AADL_Parser_Error with "Interface view is incorrect";
end if;
end if;
if Cfg.Glue then
......@@ -176,7 +179,9 @@ package body TASTE.AADL_Parser is
raise AADL_Parser_Error with "Interface view parsing error";
end;
if not Result.Configuration.Deployment_View.Is_Empty then
if Deployment_Root /= No_Node
and not Result.Configuration.Deployment_View.Is_Empty
then
AADL_Lib.Append (Result.Configuration.Interface_View.Element);
Result.Deployment_View := Parse_Deployment_View (Deployment_Root);
end if;
......
......@@ -74,8 +74,6 @@ package body TASTE.Deployment_View is
function Parse_Deployment_View (System : Node_Id)
return Complete_Deployment_View
is
-- use type Node_Maps.Map;
-- use type Taste_Busses.Vector;
use type Bus_Connections.Vector;
Nodes : Node_Maps.Map;
......
......@@ -665,6 +665,7 @@ package body TASTE.Interface_View is
return Is_Terminal;
end Rec_Function;
begin
Put_Info ("Parsing interface view");
if No (Interface_Root) then
raise Interface_Error with "Interface View parsing error";
end if;
......
......@@ -22,7 +22,7 @@ END deploymentview::DV::Node1;
PACKAGE deploymentview::DV
PUBLIC
WITH interfaceview::IV::obsw;
WITH interfaceview::IV::Obsw;
WITH interfaceview::IV::GNC;
WITH interfaceview::IV::ground;
WITH ocarina_processors_x86;
......
function1.zip
function2.zip
function1/function1.adb
function1/function1.ads
binary
This diff is collapsed.
TASTE-Dataview DEFINITIONS ::=
BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
-- A few simple types to start with ASN.1
MyInteger ::= T-UInt8
MyReal ::= REAL (0.0 .. 1000.0)
MyBool ::= BOOLEAN
MyEnum ::= ENUMERATED { hello, world, howareyou }
MySeq ::= SEQUENCE {
input-data MyInteger,
output-data MyInteger,
validity ENUMERATED { valid, invalid }
}
MyChoice ::= CHOICE {
a BOOLEAN,
b MySeq
}
MySeqOf ::= SEQUENCE (SIZE (2)) OF MyEnum
MyOctStr ::= OCTET STRING (SIZE (3))
-- You can also declare constants
myVar MySeqOf ::= { hello, world }
END
---------------------------------------------------
-- AADL2.1
-- TASTE type deploymentview
--
-- generated code: do not edit
---------------------------------------------------
PACKAGE deploymentview::DV::Node1
PUBLIC
WITH Taste;
WITH Deployment;
WITH TASTE_DV_Properties;
PROCESS blink
END blink;
PROCESS IMPLEMENTATION blink.others
END blink.others;
END deploymentview::DV::Node1;
PACKAGE deploymentview::DV
PUBLIC
WITH interfaceview::IV::Function1;
WITH interfaceview::IV::Function2;
WITH ocarina_processors_arm;
WITH deploymentview::DV::Node1;
WITH Taste;
WITH Deployment;
WITH interfaceview::IV;
WITH TASTE_DV_Properties;
SYSTEM Node1
END Node1;
SYSTEM IMPLEMENTATION Node1.others
SUBCOMPONENTS
IV_Function1 : SYSTEM interfaceview::IV::Function1::Function1.others {
Taste::FunctionName => "Function1";
};
IV_Function2 : SYSTEM interfaceview::IV::Function2::Function2.others {
Taste::FunctionName => "Function2";
};
blink : PROCESS deploymentview::DV::Node1::blink.others {
Taste::coordinates => "104907 68772 158936 96830";
Deployment::Port_Number => 0;
};
crazyflie_v2_gnat : PROCESSOR ocarina_processors_arm::crazyflie_v2.gnat {
Taste::coordinates => "98153 60599 165690 100681";
};
PROPERTIES
Taste::APLC_Binding => (reference (blink)) APPLIES TO IV_Function1;
Taste::APLC_Binding => (reference (blink)) APPLIES TO IV_Function2;
Actual_Processor_Binding => (reference (crazyflie_v2_gnat)) APPLIES TO blink;
END Node1.others;
SYSTEM deploymentview
END deploymentview;
SYSTEM IMPLEMENTATION deploymentview.others
SUBCOMPONENTS
Node1 : SYSTEM Node1.others {
Taste::coordinates => "89711 49147 174132 106407";
};
interfaceview : SYSTEM interfaceview::IV::interfaceview.others;
END deploymentview.others;
PROPERTIES
Taste::coordinates => "0 0 297000 210000";
Taste::version => "2.0";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("/home/taste/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
---------------------------------------------------
-- AADL2.1
-- TASTE type interfaceview
--
-- generated code: do not edit
---------------------------------------------------
PACKAGE interfaceview::IV::Function1
PUBLIC
WITH interfaceview::IV::Function2;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_pulse
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_pulse;
SUBPROGRAM IMPLEMENTATION PI_pulse.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_pulse.others;
SUBPROGRAM RI_Blink
FEATURES
EnableDisable : IN PARAMETER DataView::MyBool {
Taste::encoding => NATIVE;
};
END RI_Blink;
SUBPROGRAM IMPLEMENTATION RI_Blink.others
END RI_Blink.others;
SYSTEM Function1
FEATURES
PI_pulse : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Function1::PI_pulse.others {
Taste::coordinates => "317 552";
Taste::RCMoperationKind => cyclic;
Taste::RCMperiod => 1000 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "pulse";
};
RI_Blink : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::Function2::PI_Blink.others {
Taste::coordinates => "1174 588";
Taste::RCMoperationKind => any;
Taste::InterfaceName => "Blink";
Taste::labelInheritance => "true";
};
PROPERTIES
Source_Language => (SDL);
Taste::Active_Interfaces => enabled;
END Function1;
SYSTEM IMPLEMENTATION Function1.others
END Function1.others;
END interfaceview::IV::Function1;
PACKAGE interfaceview::IV::Function2
PUBLIC
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SUBPROGRAM PI_Blink
FEATURES
EnableDisable : IN PARAMETER DataView::MyBool {
Taste::encoding => NATIVE;
};
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_Blink;
SUBPROGRAM IMPLEMENTATION PI_Blink.others
PROPERTIES
Compute_Execution_Time => 0 ms .. 0 ms;
END PI_Blink.others;
SYSTEM Function2
FEATURES
PI_Blink : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Function2::PI_Blink.others {
Taste::coordinates => "1534 616";
Taste::RCMoperationKind => unprotected;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms;
Taste::InterfaceName => "Blink";
};
PROPERTIES
Source_Language => (Ada);
Taste::Active_Interfaces => enabled;
END Function2;
SYSTEM IMPLEMENTATION Function2.others
END Function2.others;
END interfaceview::IV::Function2;
PACKAGE interfaceview::IV
PUBLIC
WITH interfaceview::IV::Function1;
WITH interfaceview::IV::Function2;
WITH Taste;
WITH DataView;
WITH TASTE_IV_Properties;
SYSTEM interfaceview
PROPERTIES
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
END interfaceview;
SYSTEM IMPLEMENTATION interfaceview.others
SUBCOMPONENTS
Function1 : SYSTEM interfaceview::IV::Function1::Function1.others {
Taste::coordinates => "317 414 1174 1240";
};
Function2 : SYSTEM interfaceview::IV::Function2::Function2.others {
Taste::coordinates => "1534 415 2334 1205";
};
CONNECTIONS
Function2_PI_Blink_Function1_RI_Blink : SUBPROGRAM ACCESS Function2.PI_Blink -> Function1.RI_Blink {
Taste::coordinates => "1174 588 1347 588 1347 616 1534 616";
};
END interfaceview.others;
PROPERTIES
Taste::dataView => ("DataView");
Taste::dataViewPath => ("DataView.aadl");
Taste::coordinates => "0 0 2970 2100";
Taste::version => "2.0";
END interfaceview::IV;
KAZOO=../../kazoo
all: test-parse
cp InterfaceView.aadl output/concurrency_view && \
cp DeploymentView.aadl output/concurrency_view && \
cp DataView.aadl output/concurrency_view/D_view.aadl && \
cd output/concurrency_view && ocarina -x main.aadl
test-parse: clean
$(KAZOO) --gw \
-o output \
--glue \
--debug
gdb: clean
gdb --args $(KAZOO) --gw \
-o output \
--glue \
--debug
clean:
rm -rf output
.PHONY: clean test-parse gdb
Test case for a GNAT Runtime on STM32 processor
TASTE-BasicTypes DEFINITIONS ::=
BEGIN
-- Set of TASTE predefined basic types
T-Int32 ::= INTEGER (-2147483648 .. 2147483647)
T-UInt32 ::= INTEGER (0 .. 4294967295)
T-Int8 ::= INTEGER (-128 .. 127)
T-UInt8 ::= INTEGER (0 .. 255)
T-Boolean ::= BOOLEAN
END
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