Commit b6468fd8 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

iterate on the templates

parent 5a734114
......@@ -8,4 +8,9 @@
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@_LOWER:Name_@ :
@@IF@@ @_Language_@ = "sdl"
# Call opengeode to generate the functional code
make -C ../@_Name_@/SDL generate-code
@@ELSE@@
# Placeholder if anything has to be done for this function coded in @_Language_@
@@END_IF@@
......@@ -40,13 +40,22 @@ project @_CAPITALIZE:Name_@ is
for Source_Dirs use
(".",
"/home/taste/tool-inst/include/ocarina/runtime/polyorb-hi-ada",
"../../dataview/C",
"../../dataview/Ada",
@@TABLE@@
@@IF@@ @_Block_Languages_@ = sdl
"../../@_LOWER:Block_Names_@/@_UPPER:Block_Languages_@/code",
@@ELSE@@
"../../@_LOWER:Block_Names_@/@_UPPER:Block_Languages_@/src",
@@END_IF@@
"../../@_LOWER:Block_Names_@/@_UPPER:Block_Languages_@/wrappers",
@@END_TABLE@@
"../deploymentview_final/@_LOWER:Name_@")
& external_as_list("ADA_INCLUDE_PATH", ":");
for Object_Dir use "obj";
for Exec_Dir use "../../binaries";
for Languages use ("Ada", "C");
for Main use ("@_LOWER:Name_@.adb");
......
......@@ -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@@ @_Language_@ = sdl or @_Language_@ = ada
with @_CAPITALIZE:Name_@;
@@END_IF@@
package body @_CAPITALIZE:Name_@_Block is
@@IF@@ @_Protected_PIs_@ /= ""
......
......@@ -14,15 +14,22 @@ procedure @_CAPITALIZE:Name_@
@_CAPITALIZE:Param_Names_@ : Interfaces.C.char_array; @_CAPITALIZE:Param_Names_@_Size : Integer
@@END_TABLE@@
@@END_INLINE@@
procedure C_@_CAPITALIZE:Name_@
@@INLINE( \()(;\n )(\)\n)@@
@@TABLE'ALIGN_ON(":")@@
@_CAPITALIZE:Param_Names_@ : Interfaces.C.char_array; @_CAPITALIZE:Param_Names_@_Size : Integer
@@END_TABLE@@
@@END_INLINE@@
with Import, Convention => C, Link_Name => "@_LOWER:Parent_Function_@_@_LOWER:Name_@";
begin
null;
@@-- Works only for one param: for more than one param, use a table section
C_@_CAPITALIZE:Name_@ (@_CAPITALIZE:Param_Names_@, @_CAPITALIZE:Param_Names_@_Size);
end @_CAPITALIZE:Name_@;
@@ELSE@@
procedure @_CAPITALIZE:Name_@ is
procedure C_@_CAPITALIZE:Name_@
with Import, Convention => C, Link_Name => "@_LOWER:Parent_Function_@_@_LOWER:Name_@";
begin
-- Call user code
C_@_CAPITALIZE:Name_@;
end @_CAPITALIZE:Name_@;
......
......@@ -18,9 +18,13 @@
@@-- @_IF_Property_Names_@, _Values_@ : user properties (vector tag)
@@--
@@-- Matrix of output ports: Remote thread/corresponding remote PI @_Name_@
@@IF@@ @_Param_Names'Length_@ > 0
with Interfaces.C;
@@END_IF@@
package body @_CAPITALIZE:Thread_Name_@_Wrappers is
@@INLINE( )()()@@
@@INLINE( )()(\n)@@
@@IF@@ @_Param_Names'Length_@ > 0
@@TABLE@@
procedure @_CAPITALIZE:Entry_Port_Name_@ (dummy_Entity : Entity_Type; Param_Buffer : @_REPLACE_ALL((-)/_):Param_Types_@_Buffer_Impl) is
......@@ -28,16 +32,26 @@ package body @_CAPITALIZE:Thread_Name_@_Wrappers is
@@ELSE@@
procedure @_CAPITALIZE:Entry_Port_Name_@ (dummy_Entity : Entity_Type) is
@@END_IF@@
@@END_INLINE@@
begin
@@END_INLINE@@
@@IF@@ @_Param_Names'Length_@ > 0
null;
@@TABLE@@
@_CAPITALIZE:Param_Names_@_AdaBuffer : Interfaces.C.char_array (1 .. Interfaces.C.size_t (Param_Buffer.Length)) with Import;
for @_CAPITALIZE:Param_Names_@_AdaBuffer'Address use Param_Buffer'Address;
@@END_TABLE@@
begin
@@IF@@ @_Need_Mutex_@
@_CAPITALIZE:Pro_Block_Name_@_Block.@_CAPITALIZE:Pro_Block_Name_@_Protected.@_CAPITALIZE:Entry_Port_Name_@
@@ELSE@@
@_CAPITALIZE:Pro_Block_Name_@_Block.@_CAPITALIZE:Entry_Port_Name_@
@@END_IF@@
(@_CAPITALIZE:Param_Names_@_AdaBuffer, @_CAPITALIZE:Param_Names_@_AdaBuffer'Length);
@@ELSE@@
@@IF@@ @_Need_Mutex_@
begin
@@IF@@ @_Need_Mutex_@
@_CAPITALIZE:Pro_Block_Name_@_Block.@_CAPITALIZE:Pro_Block_Name_@_Protected.@_CAPITALIZE:Entry_Port_Name_@;
@@ELSE@@
@@ELSE@@
@_CAPITALIZE:Pro_Block_Name_@_Block.@_CAPITALIZE:Entry_Port_Name_@;
@@END_IF@@
@@END_IF@@
@@END_IF@@
end @_CAPITALIZE:Entry_Port_Name_@;
......
......@@ -2,6 +2,7 @@ KAZOO=../../kazoo
all: test-parse
make -C output
cp obsw.pr output/obsw/SDL/src
cd output/concurrency_view && \
ocarina -x main.aadl && \
make -f Makefile.taste
......
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