From b98b697de108718374a44d8b2f46878c0ad15faa Mon Sep 17 00:00:00 2001 From: Maxime Perrotin Date: Wed, 18 Sep 2019 13:52:09 +0100 Subject: [PATCH] Use a protected interface to avoid race conditions (How the hell could it work before?...) --- test/Demo_Blackbox/DeploymentView.aadl | 2 +- test/Demo_Blackbox/InterfaceView.aadl | 6 +++--- test/Demo_Blackbox/caller_in_ada/caller_in_ada.adb | 1 + test/Demo_Blackbox/caller_in_c/caller_in_c.c | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/Demo_Blackbox/DeploymentView.aadl b/test/Demo_Blackbox/DeploymentView.aadl index b2480ee..db9b2ca 100644 --- a/test/Demo_Blackbox/DeploymentView.aadl +++ b/test/Demo_Blackbox/DeploymentView.aadl @@ -74,6 +74,6 @@ PROPERTIES Taste::coordinates => "0 0 2970 2100"; Taste::version => "1.3.17"; Taste::interfaceView => "InterfaceView.aadl"; - Taste::HWLibraries => ("~/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl"); + Taste::HWLibraries => ("/home/taste/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl"); END deploymentview::DV; diff --git a/test/Demo_Blackbox/InterfaceView.aadl b/test/Demo_Blackbox/InterfaceView.aadl index 52e8df4..9d8a8ba 100644 --- a/test/Demo_Blackbox/InterfaceView.aadl +++ b/test/Demo_Blackbox/InterfaceView.aadl @@ -125,7 +125,7 @@ FEATURES }; RI_RunDriver : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::BlackBox::PI_RunDriver.others { Taste::coordinates => "1302 384"; - Taste::RCMoperationKind => unprotected; + Taste::RCMoperationKind => protected; Taste::InterfaceName => "RunDriver"; Taste::labelInheritance => "true"; }; @@ -146,7 +146,7 @@ SYSTEM BlackBox FEATURES PI_RunDriver : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::BlackBox::PI_RunDriver.others { Taste::coordinates => "1872 494"; - Taste::RCMoperationKind => unprotected; + Taste::RCMoperationKind => protected; Taste::RCMperiod => 0 ms; Taste::Deadline => 0 ms; Taste::InterfaceName => "RunDriver"; @@ -175,7 +175,7 @@ FEATURES }; RI_RunDriver : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::BlackBox::PI_RunDriver.others { Taste::coordinates => "1338 1189"; - Taste::RCMoperationKind => unprotected; + Taste::RCMoperationKind => protected; Taste::InterfaceName => "RunDriver"; Taste::labelInheritance => "true"; }; diff --git a/test/Demo_Blackbox/caller_in_ada/caller_in_ada.adb b/test/Demo_Blackbox/caller_in_ada/caller_in_ada.adb index d1c4f9c..8bbfd4c 100644 --- a/test/Demo_Blackbox/caller_in_ada/caller_in_ada.adb +++ b/test/Demo_Blackbox/caller_in_ada/caller_in_ada.adb @@ -24,6 +24,7 @@ package body caller_in_ada is --------------------------------------------------------- procedure pulse is begin + System.IO.Put_Line ("[Ada] Calling in Ada"); RunDriver(i1, i2, o1, o2); system.io.put("[Ada] i1="); diff --git a/test/Demo_Blackbox/caller_in_c/caller_in_c.c b/test/Demo_Blackbox/caller_in_c/caller_in_c.c index 603804f..92e401b 100644 --- a/test/Demo_Blackbox/caller_in_c/caller_in_c.c +++ b/test/Demo_Blackbox/caller_in_c/caller_in_c.c @@ -12,6 +12,7 @@ void caller_in_c_PI_pulse() { static asn1SccMyInteger i1=0, i2=1, o1, o2; + printf("[C] Calling in C\n"); caller_in_c_RI_RunDriver(&i1, &i2, &o1, &o2); printf ("[C] i1 = %lld, i2 = %lld, o1 = %lld, o2 = %lld", i1,i2,o1,o2); -- GitLab