Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
kazoo
Commits
364eb12d
Commit
364eb12d
authored
Jul 31, 2019
by
Maxime Perrotin
Browse files
Cleanup here and there
parent
4021c3a6
Changes
17
Hide whitespace changes
Inline
Side-by-side
src/taste-concurrency_view.adb
View file @
364eb12d
...
...
@@ -258,15 +258,6 @@ package body TASTE.Concurrency_View is
for
T
of
Partition
.
Threads
loop
declare
-- There is no "&" operator for Translate sets...
function
Join_Sets
(
S1
,
S2
:
Translate_Set
)
return
Translate_Set
is
Result
:
Translate_Set
:=
S1
;
begin
Insert
(
Result
,
S2
);
return
Result
;
end
Join_Sets
;
-- Render each thread
Name
:
constant
String
:=
To_String
(
T
.
Name
);
Thread_Assoc
:
constant
Translate_Set
:=
...
...
@@ -365,7 +356,9 @@ package body TASTE.Concurrency_View is
RI_Assoc
&
Assoc
(
"Partition_Name"
,
Partition_Name
)));
end
loop
;
Block_Assoc
:=
Block_Assoc
Block_Assoc
:=
Join_Sets
(
Block_Assoc
,
CV
.
Configuration
.
To_Template
)
&
Assoc
(
"Protected_PIs"
,
Pro_PI_Tag
)
&
Assoc
(
"Unprotected_PIs"
,
Unpro_PI_Tag
)
&
Assoc
(
"Required"
,
RI_Tag
);
...
...
src/taste-parser_utils.adb
View file @
364eb12d
...
...
@@ -289,4 +289,12 @@ package body TASTE.Parser_Utils is
Ocarina
.
FE_AADL
.
Parser
.
Add_Pre_Prop_Sets
:=
True
;
end
Initialize_Ocarina
;
-- There is no "&" operator for Translate sets...
function
Join_Sets
(
S1
,
S2
:
Translate_Set
)
return
Translate_Set
is
Result
:
Translate_Set
:=
S1
;
begin
Insert
(
Result
,
S2
);
return
Result
;
end
Join_Sets
;
end
TASTE
.
Parser_Utils
;
src/taste-parser_utils.ads
View file @
364eb12d
...
...
@@ -153,6 +153,10 @@ package TASTE.Parser_Utils is
-- Define a vector for template_parser translate sets
package
Translate_Sets
is
new
Indefinite_Vectors
(
Natural
,
Translate_Set
);
-- There is no "&" operator for Translate sets...
function
Join_Sets
(
S1
,
S2
:
Translate_Set
)
return
Translate_Set
;
private
Debug_Mode
:
Boolean
:=
False
;
end
TASTE
.
Parser_Utils
;
templates/concurrency_view/aadl_2_threads/block.tmplt
View file @
364eb12d
...
...
@@ -7,6 +7,10 @@
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@@IF@@ @_Protected_PIs_@ /= ""
@@-- And all the system configuration obtained from the command line:
@@-- Interface_View, Deployment_View, Data_View, Binary_Path, Check_Data_View,
@@-- Output_Dir, Skeletons, Glue, Use_POHIC, Timer_Resolution, Debug_Flag,
@@-- No_Stdlib_Flag, Timer_Resolution, Other_Files (list of aadl files)
@@IF@@ @_Protected_PIs_@ /= "" and @_Use_POHIC_@
@_LOWER:Name_@_protected : data TASTE_Protected.Object;
@@END_IF@@
templates/concurrency_view/aadl_2_threads/system.tmplt
View file @
364eb12d
...
...
@@ -44,17 +44,17 @@ public
@@
END_TABLE
@@
@@--
POHIC
-
only
:
declare
protected
objects
to
have
runtime
mutex
@@--
@@
IF
@@
@
_Use_POHIC_
@
data
T
aste
_Protected
@@
IF
@@
@
_Use_POHIC_
@
data
T
ASTE
_Protected
properties
Concurrency_Control_Protocol
=>
Protected_Access
;
end
T
aste
_Protected
;
end
T
ASTE
_Protected
;
data
implementation
T
aste
_Protected
.
Object
data
implementation
T
ASTE
_Protected
.
Object
properties
Concurrency_Control_Protocol
=>
Protected_Access
;
end
T
aste
_Protected
.
Object
;
@@--
@@
END_IF
@@
end
T
ASTE
_Protected
.
Object
;
@@
END_IF
@@
@
_Nodes_
@
...
...
templates/concurrency_view/pohic_wrappers_body/pi.tmplt
View file @
364eb12d
...
...
@@ -13,7 +13,7 @@
@@-- @_Calling_Threads_@ : Calling threads of the containing block
@@IF@@ @_Kind_@ = PROTECTED_OPERATION
@@IF@@ @_Param_Names'Length_@ = 0 @@-- zero param
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@()
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@(
void
)
@@ELSE@@ @@-- contains param(s)
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\)\n)@@
...
...
templates/concurrency_view/pohic_wrappers_header/pi.tmplt
View file @
364eb12d
...
...
@@ -13,7 +13,7 @@
@@-- @_Calling_Threads_@ : Calling threads of the containing block
@@IF@@ @_Kind_@ = PROTECTED_OPERATION
@@IF@@ @_Param_Names'Length_@ = 0 @@-- zero param
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@();
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@(
void
);
@@ELSE@@ @@-- contains param(s)
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\);)@@
...
...
templates/glue/language_wrappers/vm_if-body/function.tmplt
View file @
364eb12d
...
...
@@ -40,6 +40,10 @@
#include <stdio.h>
#endif
@@IF@@ @_Language_@ = Ada or @_Language_@ = SDL
extern void adainit(void);
@@END_IF@@
void init_@_LOWER:Name_@()
{
static bool init = false;
...
...
@@ -52,7 +56,6 @@ void init_@_LOWER:Name_@()
@_LOWER:Name_@_startup();
@@ELSIF@@ @_Language_@ = Ada or @_Language_@ = SDL
// Initialize Ada runtime to call elaboration functions
extern void adainit();
adainit();
@@END_IF@@
@@IF@@ @_EXIST:Sync_RIs_Parent_@
...
...
@@ -60,7 +63,7 @@ void init_@_LOWER:Name_@()
// init function. Multiple calls are prevented by the "init" guard.
@@END_IF@@
@@TABLE@@
extern void init_@_LOWER:Sync_RIs_Parent_@();
extern void init_@_LOWER:Sync_RIs_Parent_@(
void
);
init_@_LOWER:Sync_RIs_Parent_@();
@@END_TABLE@@
puts ("[TASTE] Initialization completed for function @_Name_@");
...
...
templates/glue/language_wrappers/vm_if-body/interface.tmplt
View file @
364eb12d
...
...
@@ -85,7 +85,7 @@ void @_LOWER:Parent_Function_@_@_LOWER:Name_@()
// Directly call user code, no parameters to pass
// This could be done directly from the concurrency glue...
@@IF@@ @_Language_@ /= GUI
extern void @_LOWER:Parent_Function_@_PI_@_LOWER:Name_@();
extern void @_LOWER:Parent_Function_@_PI_@_LOWER:Name_@(
void
);
@_LOWER:Parent_Function_@_PI_@_LOWER:Name_@();
// puts ("@_LOWER:Parent_Function_@_@_LOWER:Name_@ called");
@@END_IF@@
...
...
templates/glue/language_wrappers/vm_if-header/function.tmplt
View file @
364eb12d
...
...
@@ -67,10 +67,10 @@ extern "C" {
@@END_IF@@
// Function initialization - calls user startup code of all dependent functions
void init_@_LOWER:Name_@();
void init_@_LOWER:Name_@(
void
);
@@IF@@ @_Language_@ = "Ada" or @_Language_@ = "QGenAda"
extern void adainit();
extern void adainit(
void
);
@@END_IF@@
@@IF@@ @_EXIST:Provided_Interfaces_@ and @_Language_@ /= "Blackbox_C"
...
...
templates/glue/language_wrappers/vm_if-header/interface.tmplt
View file @
364eb12d
...
...
@@ -24,6 +24,6 @@ void *OUT_@_LOWER:Param_Names_@, size_t *OUT_@_LOWER:Param_Names_@_len
@@END_TABLE@@
@@END_INLINE@@
@@ELSE@@
void @_LOWER:Parent_Function_@_@_LOWER:Name_@();
void @_LOWER:Parent_Function_@_@_LOWER:Name_@(
void
);
@@END_IF@@
@@END_IF@@
templates/skeletons/README.md
View file @
364eb12d
...
...
@@ -126,7 +126,7 @@ For example this is an extract of the C template:
extern "C" {
#endif
void @_LOWER:Name_@_startup();
void @_LOWER:Name_@_startup(
void
);
/* Provided interfaces */
@@TABLE@@
...
...
templates/skeletons/blackbox-c-body/interface.tmplt
View file @
364eb12d
...
...
@@ -20,7 +20,7 @@ void @_LOWER:Parent_Function_@_@_LOWER:Name_@
@@END_TABLE@@
@@END_INLINE@@
@@ELSE@@
void @_LOWER:Parent_Function_@_@_LOWER:Name_@()
void @_LOWER:Parent_Function_@_@_LOWER:Name_@(
void
)
@@END_IF@@
{
// Write your code here
...
...
templates/skeletons/c-body/function.tmplt
View file @
364eb12d
...
...
@@ -39,7 +39,7 @@
#include "Context-@_LOWER:Name_@.h"
@@END_IF@@
void @_LOWER:Name_@_startup()
void @_LOWER:Name_@_startup(
void
)
{
// Write your initialisation code, but DO NOT CALL REQUIRED INTERFACES
// puts ("[@_Name_@] Startup");
...
...
@@ -51,7 +51,7 @@ void @_LOWER:Name_@_startup()
@@END_TABLE@@
@@TABLE@@
void @_LOWER:Name_@_PI_@_Timers_@()
void @_LOWER:Name_@_PI_@_Timers_@(
void
)
{
// This function is called when the timer expires
}
...
...
templates/skeletons/c-body/interface.tmplt
View file @
364eb12d
...
...
@@ -22,7 +22,7 @@ asn1Scc@_REPLACE_ALL((-)/_):Param_Types_@ *OUT_@_LOWER:Param_Names_@
@@END_TABLE@@
@@END_INLINE@@
@@ELSE@@
void @_LOWER:Parent_Function_@_PI_@_LOWER:Name_@()
void @_LOWER:Parent_Function_@_PI_@_LOWER:Name_@(
void
)
@@END_IF@@
{
// Write your code here
...
...
templates/skeletons/c-header/function.tmplt
View file @
364eb12d
...
...
@@ -48,7 +48,7 @@ extern "C" {
typedef unsigned size_t;
#endif
void @_LOWER:Name_@_startup();
void @_LOWER:Name_@_startup(
void
);
/* Provided interfaces */
@@TABLE@@
...
...
@@ -61,10 +61,10 @@ void @_LOWER:Name_@_startup();
@@END_TABLE@@
@@TABLE@@
void @_LOWER:Name_@_PI_@_Timers_@();
void @_LOWER:Name_@_PI_@_Timers_@(
void
);
/* Call these functions to set/reset @_Timers_@ (value in milliseconds)*/
void @_LOWER:Name_@_RI_SET_@_Timers_@(asn1SccT_UInt32 *);
void @_LOWER:Name_@_RI_RESET_@_Timers_@();
void @_LOWER:Name_@_RI_RESET_@_Timers_@(
void
);
@@END_TABLE@@
#ifdef __cplusplus
...
...
templates/skeletons/cpp-body/interface.tmplt
View file @
364eb12d
...
...
@@ -19,7 +19,7 @@ asn1Scc@_REPLACE_ALL((-)/_):Param_Types_@ *OUT_@_LOWER:Param_Names_@
@@END_TABLE@@
@@END_INLINE@@
@@ELSE@@
void @_LOWER:Parent_Function_@_PI_@_LOWER:Name_@()
void @_LOWER:Parent_Function_@_PI_@_LOWER:Name_@(
void
)
@@END_IF@@
{
// Write your code here
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment