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

Cleanup template documentation engine

parent a7d33526
all:
mkdir -p tmp
mkdir -p new-templates
# Extract the latest template tags from any demo project and put them in the new-templates folder
cd ../test/test-cv && kazoo --doc -o ../../doc/tmp --gw -g --glue && mv ../../doc/tmp/Dump/Doc/* ../../doc/new-templates
mkdir -p preprocess
cp templates/templates_from_wiki preprocess # copy the previous one
rm templates/* # delete the old templates
$(MAKE) -C preprocess
cp preprocess/output/order.txt .
./kazoo-merge-doc.py
rm -rf tmp new-templates
clean:
rm -rf preprocess/output/*
......
......@@ -156,6 +156,7 @@ def process_one_file (tmplt: str, old: str, new: str, res_folder: str) -> None:
newdoc.append("|}")
with open (res_folder+"/"+tmplt, "w") as output:
LOG.debug (f"Writing to {res_folder}/{tmplt}")
output.write("\n".join (newdoc))
......@@ -181,7 +182,8 @@ def run(options):
wiki_output.write("== Templates ==\n")
for each in orderlist:
name=each.strip()
filename=each.strip()
name=filename.replace("/", "_").replace("-", "_").split(".tmplt")[0]
try:
process_one_file (tmplt=name,
old=old_folder+"/"+name,
......@@ -190,7 +192,7 @@ def run(options):
except FileNotFoundError:
pass
else:
wiki_output.write(f"\n=== {name} ===\n")
wiki_output.write(f"\n=== {filename} ===\n")
pre_content=open(result_folder+"/"+name+".pre", "r").readlines()
middle_content=open(result_folder+"/"+name, "r").readlines()
post_content=open(result_folder+"/"+name+".post", "r").readlines()
......
templates_build_script
templates_skeletons_makefile
templates_skeletons_context_parameters
templates_skeletons_sub_trigger
templates_skeletons_sub_makefile_filename
templates_skeletons_sub_function_filename
templates_skeletons_sub_interface
templates_skeletons_sub_makefile
templates_skeletons_sub_function
templates_concurrency_view_sub_filenode
templates_concurrency_view_sub_trigger
templates_concurrency_view_sub_filepart
templates_concurrency_view_sub_thread
templates_concurrency_view_sub_filethread
templates_concurrency_view_sub_fileblock
templates_concurrency_view_sub_pi
templates_concurrency_view_sub_ri
templates_concurrency_view_sub_block
templates_concurrency_view_sub_partition
templates_concurrency_view_sub_node
templates_concurrency_view_sub_system
templates/skeletons/makefile.tmplt
templates/skeletons/context-parameters.tmplt
templates/skeletons/sub/trigger.tmplt
templates/skeletons/sub/makefile-filename.tmplt
templates/skeletons/sub/function-filename.tmplt
templates/skeletons/sub/interface.tmplt
templates/skeletons/sub/makefile.tmplt
templates/concurrency_view/sub/trigger.tmplt
templates/concurrency_view/sub/thread.tmplt
templates/concurrency_view/sub/pi.tmplt
templates/concurrency_view/sub/ri.tmplt
templates/concurrency_view/sub/block.tmplt
templates/concurrency_view/sub/partition.tmplt
templates/concurrency_view/sub/node.tmplt
templates/concurrency_view/sub/system.tmplt
......@@ -19,6 +19,4 @@ find . -type f -iname '*.post' | \
while read ANS ; do \
cat "$ANS" | sed 1d > output/"$(echo ${ANS/.tmplt.post/.post} | sed 's,[/-],_,g')"
done
sed -i 's,[/-],_,g' output/order.txt
sed -i 's,\..*,,g' output/order.txt
rm -rf templates
{| class="wikitable"
!Parameter name
!Description
|-
|Name
|Protected block name
|-
|Language
|Implementation language
|-
|Calling_Threads
|List of calling threads
|-
|Protected_PIs
|Protected Provided interfaces (from pi.tmplt)
|-
|Unprotected_PIs
|Unprotected Provided interfaces (from pi.tmplt)
|-
|Required
|Required interfaces (from ri.tmplt)
|-
|List_Of_PIs
|DOCUMENTATION MISSING
|-
|PIs_Have_Params
|DOCUMENTATION MISSING
|-
|CP_Names
|DOCUMENTATION MISSING
|-
|CP_Values
|DOCUMENTATION MISSING
|-
|Node_Name
|DOCUMENTATION MISSING
|-
|ASync_PI_Param_Type
|DOCUMENTATION MISSING
|-
|Has_Context
|DOCUMENTATION MISSING
|-
|No_Stdlib_Flag
|DOCUMENTATION MISSING
|-
|Deployment_View
|DOCUMENTATION MISSING
|-
|CP_Types
|DOCUMENTATION MISSING
|-
|List_Of_ASync_PIs
|DOCUMENTATION MISSING
|-
|Interface_View
|DOCUMENTATION MISSING
|-
|Instance_Of
|DOCUMENTATION MISSING
|-
|ASync_RI_Param_Name
|DOCUMENTATION MISSING
|-
|Debug_Flag
|DOCUMENTATION MISSING
|-
|Property_Values
|DOCUMENTATION MISSING
|-
|Data_View
|DOCUMENTATION MISSING
|-
|List_Of_Sync_RIs
|DOCUMENTATION MISSING
|-
|Use_POHIC
|DOCUMENTATION MISSING
|-
|Output_Dir
|DOCUMENTATION MISSING
|-
|CP_Asn1Modules
|DOCUMENTATION MISSING
|-
|Sync_RIs_Parent
|DOCUMENTATION MISSING
|-
|Timer_Resolution
|DOCUMENTATION MISSING
|-
|Check_Data_View
|DOCUMENTATION MISSING
|-
|List_Of_Sync_PIs
|DOCUMENTATION MISSING
|-
|Other_Files
|DOCUMENTATION MISSING
|-
|Skeletons
|DOCUMENTATION MISSING
|-
|List_Of_ASync_RIs
|DOCUMENTATION MISSING
|-
|List_Of_RIs
|DOCUMENTATION MISSING
|-
|Glue
|DOCUMENTATION MISSING
|-
|CP_Asn1Filenames
|DOCUMENTATION MISSING
|-
|Zip_File
|DOCUMENTATION MISSING
|-
|Async_RIs_Parent
|DOCUMENTATION MISSING
|-
|Partition_Name
|DOCUMENTATION MISSING
|-
|ASync_RI_Param_Type
|DOCUMENTATION MISSING
|-
|Property_Names
|DOCUMENTATION MISSING
|-
|Binary_Path
|DOCUMENTATION MISSING
|-
|RIs_Have_Params
|DOCUMENTATION MISSING
|-
|Timers
|DOCUMENTATION MISSING
|-
|Is_Type
|DOCUMENTATION MISSING
|-
|ASync_PI_Param_Name
|DOCUMENTATION MISSING
|}
\ No newline at end of file
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)
This template is evaluated for every block.
{| class="wikitable"
!Parameter name
!Description
|-
|Node_Name
|Name of the node from deployment view
|-
|Partition_Names
|Tag listing the partitions in this node
|-
|Has_Memory
|Boolean flag indicating that a memory is defined for this node
|-
|Partitions
|List of rendered code for partitions
|-
|VP_Names
|Vector tag: list of virtual processors on this node
|-
|VP_Package_Names
| |_ Corresponding package name
|-
|VP_Platforms
| |_ Corresponding platform name
|-
|VP_Classifiers
| |_ Corresponding aadl classifier
|-
|CPU_Classifier
|DOCUMENTATION MISSING
|-
|CPU_Family
|DOCUMENTATION MISSING
|-
|CPU_Instance
|DOCUMENTATION MISSING
|-
|CPU_Name
|DOCUMENTATION MISSING
|-
|Package_Name
|DOCUMENTATION MISSING
|-
|CPU_Platform
|DOCUMENTATION MISSING
|-
|Ada_Runtime
|DOCUMENTATION MISSING
|}
\ No newline at end of file
This file is evaluated for every node. The result of this file is saved to the file with name returned by filenode.tmplt. The result is also used as a parameter for system.tmplt.
{| class="wikitable"
!Parameter name
!Description
|-
|Name
|Partition name (usually the name of the binary)
|-
|Threads
|Code generated for the threads
|-
|Thread_Names
|Tag: list of thread names
|-
|Node_Name
|Name of the node containing this partition
|-
|Blocks
|Code generated for protected functions
|-
|Block_Names
|Tag: list of block (user functions) names
|-
|Coverage
|True if user requested code coverage enable
|-
|Package_Name
|AADL Package name for the target (e.g. ocarina_porocessors_x86)
|-
|CPU_Name
|CPU AADL Identifier (e.g. x86_inst)
|-
|CPU_Family
|CPU Kind (e.g. leon3)
|-
|CPU_Instance
|AADL component instance (e.g. rtems_posix)
|-
|CPU_Platform
|AADL CPU_Platform (e.g. PLATFORM_NATIVE)
|-
|CPU_Classifier
|AADL CPU Classifier (e.g. ocarina_processors_x86::x86.linux)
|-
|VP_Name
|Virtual processor name on which the partition is bounded
|-
|VP_Platform
|Virtual processor platform (e.g. PLATFORM_AIR)
|-
|VP_Classifier
|Virtual processor classifier
|-
|Bound_Functions
|List of user functions from Interface view
|-
|Thread_Src_Name
|Vector tag : connection thread name (source)
|-
|Thread_Dst_Name
|Vector tag : connection thread name (dest)
|-
|Thread_Src_Port
|Vector tag : connection port name (source)
|-
|Thread_Dst_Port
|Vector tag : connection port name (dest)
|-
|In_Port_Names
|Vector tag: input ports of the partition
|-
|In_Port_Thread_Name
| |_ corresponding thread inside the partition
|-
|In_Port_Type_Name
| |_ corresponding parameter type name (optional)
|-
|Out_Port_Names
|Vector tag: output ports of the partition
|-
|Out_Port_Type_Name
| |_ corresponding parameter type name (optional)
|-
|Part_Out_Port_Name
|Vector tag: output ports of the partition (can be several times the same)
|-
|Connected_Threads
| |_ Corresponding thread connected to it
|-
|Block_Languages
|DOCUMENTATION MISSING
|-
|Ada_Runtime
|DOCUMENTATION MISSING
|-
|Block_Instance_Of
|DOCUMENTATION MISSING
|-
|Memory_Region
|DOCUMENTATION MISSING
|-
|Thread_Has_Param
|DOCUMENTATION MISSING
|-
|VP_Duration
|DOCUMENTATION MISSING
|-
|VP_Package_Name
|DOCUMENTATION MISSING
|}
\ No newline at end of file
{| class="wikitable"
!Parameter name
!Description
|-
|Name
|The name of the interface
|-
|Kind
|The RCM Kind
|-
|Parent_Function
|The name of the function
|-
|Param_Names
|List of parameter names
|-
|Param_Types
| |_ Corresponding parameter types
|-
|Param_Directions
| |_ Corresponding direction
|-
|IF_Property_Values
|DOCUMENTATION MISSING
|-
|Period
|DOCUMENTATION MISSING
|-
|Is_Timer
|DOCUMENTATION MISSING
|-
|Param_Encodings
|DOCUMENTATION MISSING
|-
|Remote_Interface_Names
|DOCUMENTATION MISSING
|-
|Remote_Languages
|DOCUMENTATION MISSING
|-
|Language
|DOCUMENTATION MISSING
|-
|Queue_Size
|DOCUMENTATION MISSING
|-
|IF_Property_Names
|DOCUMENTATION MISSING
|-
|Calling_Threads
|DOCUMENTATION MISSING
|-
|Remote_Function_Names
|DOCUMENTATION MISSING
|-
|Caller_Is_Local
|DOCUMENTATION MISSING
|-
|Partition_Name
|DOCUMENTATION MISSING
|-
|WCET
|DOCUMENTATION MISSING
|-
|Param_ASN1_Modules
|DOCUMENTATION MISSING
|-
|Protected_Block_Name
|DOCUMENTATION MISSING
|}
\ No newline at end of file
The template pi.tmplt is evaluated many times for every protected and unprotected provided interface.
The result of every evaluation is joined to one string and passed as a parameter to block.tmplt
{| class="wikitable"
!Parameter name
!Description
|-
|Name
|The name of the interface
|-
|Kind
|The RCM Kind
|-
|Parent_Function
|The name of the function
|-
|Param_Names
|List of parameter names
|-
|Param_Types
|Corresponding parameter types
|-
|Param_Directions
|Corresponding direction
|-
|IF_Property_Values
|DOCUMENTATION MISSING
|-
|Period
|DOCUMENTATION MISSING
|-
|Is_Timer
|DOCUMENTATION MISSING
|-
|Param_Encodings
|DOCUMENTATION MISSING
|-
|Remote_Interface_Names
|DOCUMENTATION MISSING
|-
|Remote_Languages
|DOCUMENTATION MISSING
|-
|Language
|DOCUMENTATION MISSING
|-
|Queue_Size
|DOCUMENTATION MISSING
|-
|IF_Property_Names
|DOCUMENTATION MISSING
|-
|Calling_Threads
|DOCUMENTATION MISSING
|-
|Remote_Function_Names
|DOCUMENTATION MISSING
|-
|Partition_Name
|DOCUMENTATION MISSING
|-
|WCET
|DOCUMENTATION MISSING
|-
|Param_ASN1_Modules
|DOCUMENTATION MISSING
|}
\ No newline at end of file
The template ri.tmplt is evaluated many times for every required interface.
The result of every evaluation is koined to one string and passed as a parameter to block.tmplt
{| class="wikitable"
!Parameter name
!Description
|-
|Nodes
|Code generated for the nodes
|-
|Node_Names
|Vector Tag of node names
|-
|Node_CPU
|Corresponding CPU name (eg x86_linux)
|-
|Node_CPU_Classifier
|CPU Classifier (ocarina...::x86_linux)
|-
|Node_Major_Frame
|Time in milliseconds allocated to the CPU (TSP only)
|-
|Partition_Names
|Vector Tag of partition names
|-
|Partition_Node
|Corresponding node name
|-
|Partition_CPU
|Corresponding CPU name
|-
|Partition_Duration
|Corresponding time allocation (TSP only)
|-
|Partition_VP
|Virtual processor binding (TSP only)
|-
|Threads
|Code generated for the threads
|-
|Thread_Names
|List of all threads in the complete system
|-
|Target_Packages
|List of all target package names in the complete system
|-
|Part_Source_Name
|Inter-partition connections : partition source name (vector tag)
|-
|Part_Source_Port
| |_ Corresponding port name
|-
|Part_Dest_Name
| |_ Corresponding name of the remote partition
|-
|Part_Dest_Port
| |_ Corresponding name of the port on the remote partition
|-
|Bus_Names
|Vector tag: busses present in the system
|-
|Bus_AADL_Package
| |_ corresponding AADL Package
|-
|Bus_Classifier
| |_ corresponding AADL classifier
|-
|Device_Node_Name
|
|-
|Device_Partition
|-