Commit 0a4712a0 authored by Maxime Perrotin's avatar Maxime Perrotin

Add support for rtems builds with pohic

parent 44269ae4
......@@ -20,11 +20,36 @@
@@-- @_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)
@@INLINE@@
@@INLINE()( )(\n)@@
@_LOWER:Name_@ :
@@TABLE@@
@_LOWER:Block_Names_@
@@END_TABLE@@
@@END_INLINE@@
@@-- On RTEMS if using POHIC we need to have adainit created for Ada functions
@@-- Here we miss the configuration? Please add... We don't need that for POHIAda
@@--@@IF@@ @_CPU_Platform_@ /= PLATFORM_NATIVE
mkdir -p @_LOWER:Name_@_adainit && \
@@INLINE( echo ')()()@@
@@TABLE@@
@@IF@@ @_LOWER:Block_Languages_@ = sdl or @_LOWER:Block_Languages_@ = ada
with @_CAPITALIZE:Block_Names_@;
@@END_IF@@
@@END_TABLE@@
package adainit is end adainit;' >@_LOWER:Name_@_adainit/tasteada.ads && \
@@END_INLINE@@
cd @_LOWER:Name_@_adainit && \
@@INLINE( )(:)( )@@
ADA_INCLUDE_PATH=../../dataview/Ada
@@TABLE'TERSE@@
@@IF@@ @_LOWER:Block_Languages_@ = sdl
../../@_LOWER:Block_Names_@/SDL/code
@@ELSIF@@ @_LOWER:Block_Languages_@ = ada
../../@_LOWER:Block_Names_@/Ada/src
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
sparc-rtems5-gnatmake -c tasteada.ads && sparc-rtems5-gnatbind -t -n tasteada.ali -o ada-start.adb && mkdir -p ../@_LOWER:Node_Name_@/ada_code_startup && mv ada-start.* ../@_LOWER:Node_Name_@/ada_code_startup
@@--@@END_IF@@
@_Blocks_@
......@@ -6,14 +6,19 @@
@@-- @_CPU_Name_@, _Platform_@, _Classifier_@, _Ada_Runtime_@ : Info about CPU
@@-- In standard TASTE systems there is only one partition per node
# @_Node_Name_@ @_CPU_Name_@ @_Ada_Runtime_@
all: debug
all: debug_native
debug:
debug_native:
@@TABLE@@
gprbuild -p -P @_LOWER:Partition_Names_@.gpr -XCFG="Debug" -cargs:C -DSTATIC=""
@@END_TABLE@@
release:
debug_rtems_leon3_with_ada:
@@TABLE@@
gprbuild --config=rtems_ada.cgpr -P @_LOWER:Partition_Names_@_rtems_ada.gpr -XCFG="Debug" -cargs:C -DSTATIC=""
@@END_TABLE@@
release_native:
@@TABLE@@
gprbuild -p -P @_LOWER:Partition_Names_@.gpr -XCFG="Release" -cargs:C -DSTATIC=""
@@END_TABLE@@
Generate a gpr configuration file for RTEMS with Ada support (POHIC)
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : Protected block name
@@-- @_Language_@ : Implementation language
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Node name_@ : Node name
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@@-- Specify the file name for a protected block
@@-- @_Block_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@@-- The following tags are available in this template:
@@--
@@-- @_Node_Name_@ : Name of the node as defined in the Deployment View
@@-- The content of this file is generated from node.tmplt
@@-- If there is no string defined here, no file will be generated per node,
@@-- (that's an option if the intent is to generate only one file per system)
@@-- Specify the file name for a partition
@@-- @_Partition_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
rtems_ada.cgpr
@@-- Specify the file name for the complete system (including nodes)
@@-- (no template tag)
@@-- Specify the file name for a thread
@@-- @_Thread_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@@-- The following tags are available in this template:
@@--
@@-- @_Node_Name_@ : Name of the node from deployment view
@@-- @_Partition_Names_@ : Tag listing the partitions in this node
@@-- @_Partitions_@ : List of rendered code for partitions
@@-- @_CPU_Name_@, _Platform_@, _Classifier_@, _Ada_Runtime_@ : Info about CPU
@@-- The following tags are available in this template:
@@--
@@-- @_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@ : Vector Tag: list of block (user functions) names
@@-- @_Block_Languages@ : |_ Corresponding implementation language
@@-- @_Coverage_@ : True if user requested code coverage enable
@@-- @_Package_Name_@ : AADL Package name for the target (e.g. ocarina_porocessors_x86)
@@-- @_CPU_Name_@ : CPU Name (e.g. x86_linux)
@@-- @_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
@@-- @_Ada_Runtime_@ : Set if CPU_Platform = PLATFORM_GNAT_RUNTIME
@@-- @_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)
-- Node name : @_Name_@
-- Execution platform : @_CPU_Platform_@
-- Generic gprbuild configuration file for rtems5 with Ada support for leon3
configuration project RTEMS_WITH_ADA is
package Compiler is
for Driver ("C") use "sparc-rtems5-gcc";
for Driver ("Ada") use "sparc-rtems5-gcc";
for Leading_Required_Switches ("C") use ("-c");
for Required_Switches("Ada") use
("-c",
"-x",
"ada",
"-gnatA");
for Required_Switches("C") use
("--pipe",
"-DTARGET=leon.rtems_posix",
"-DRTEMS_POSIX",
"-DRTEMS410",
"-DGRLEON3",
"-DLEON_RTEMS",
"-DLEON3",
"-DGAISLER",
"-DNDEBUG",
"-B/opt/rtems-ada/sparc-rtems5/leon3/lib",
"-specs=bsp_specs",
"-qrtems",
"-mcpu=cypress",
"-DBSP_leon3",
"-DCORES=1");
for Object_File_Suffix ("C") use ".o";
for Object_File_Suffix ("Ada") use ".o";
for Dependency_Switches ("C") use ("-Wp,-MD,");
for Dependency_Switches ("Ada") use ("-MMD","-MF","");
for Include_Switches ("C") use ("-I");
for Include_Switches ("Ada") use ("-I");
for Include_Path ("Ada") use "ADA_INCLUDE_PATH";
for Include_Path_File ("Ada") use "ADA_PRJ_INCLUDE_FILE";
for Mapping_File_Switches ("Ada") use ("-gnatem=");
end Compiler;
package Naming is
for Spec_Suffix ("C") use ".h";
for Body_Suffix ("C") use ".c";
for Spec_Suffix ("Ada") use ".ads";
for Body_Suffix ("Ada") use ".adb";
for Dot_Replacement use "-";
end Naming;
for Archive_Builder use ("ar" , "cr");
package Linker is
for Driver use "sparc-rtems5-gcc";
for Default_Switches ("C") use
("--pipe",
"-g",
"-B/opt/rtems-ada/sparc-rtems5/leon3/lib",
"-specs=bsp_specs",
"-qrtems",
"-lm",
"-L/opt/rtems-ada/lib/gcc/sparc-rtems5/7.3.0/leon3/adalib",
"-lgnat",
"-lgnarl",
"-mcpu=cypress");
for Default_Switches ("Ada") use
("--pipe",
"-g",
"-B/opt/rtems-ada/sparc-rtems5/leon3/lib",
"-specs=bsp_specs",
"-qrtems",
"-lm",
"-lgnat",
"-mcpu=cypress");
end Linker;
end RTEMS_WITH_ADA;
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the interface
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_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
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the interface
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_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
@@-- The following tags are available in this template:
@@--
@@-- @_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)
@@-- @_Partition_Names_@ : Vector Tag of partition names
@@-- @_Partition_Node_@ : |_ Corresponding node name
@@-- @_Partition_CPU_@ : |_ Corresponding CPU name
@@-- @_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
@@-- 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)
@@-- The following tags are available in this template:
@@--
@@-- @_Thread_Name_@ : Thread name
@@-- @_Entry_Port_Name_@ : Name of the PI
@@-- @_RCM_@ : One of "CYCLIC_OPERATION", "SPORADIC_OPERATION"
@@-- @_Pro_Block_Name_@ : Name of the protected function
@@-- @_Node_Name_@ : Name of the deployment node
@@-- @_Remote_Threads_@ : Vector tag: output remote thread list
@@-- @_RI_Port_Name_@ : |_ Corresponding local RI name
@@-- @_Remote_PIs_@ : |_ Associated PI Name
@@-- @_Remote_PI_Sorts_@ : |_ Optional param type of the remote thread
@@-- @_Remote_PI_Modules_@ : |_ Asn1 module of the optional param type
@@-- Tags related to the PI that is at the origin of the thread creation:
@@-- @_Name_@, @_Kind_@, @_Parent_Function_@ : shoud be useless here
@@-- @_Param_Names_@, _Types_@, _ASN1_Modules, _Encodings_@, _Directions_@ : param vector tag
@@-- @_Period_@, @_WCET_@, @_Queue_Size_@ : relevant here
@@-- @_IF_Property_Names_@, _Values_@ : user properties (vector tag)
@@--
@@-- Matrix of output ports: Remote thread/corresponding remote PI @_Name_@
@@-- The following boolean tags are available to decide if the file
@@-- shall be generated or not:
@@-- Filename_Is_Present
@@-- Skeletons
@@-- Glue
@@-- Use_POHIC
@@-- Debug
@@-- No_Stdlib
@_Use_POHIC_@
Generate a gpr configuration file for RTEMS with Ada support (POHIC)
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : Protected block name
@@-- @_Language_@ : Implementation language
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Node name_@ : Node name
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@@-- Specify the file name for a protected block
@@-- @_Block_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@@-- The following tags are available in this template:
@@--
@@-- @_Node_Name_@ : Name of the node as defined in the Deployment View
@@-- The content of this file is generated from node.tmplt
@@-- If there is no string defined here, no file will be generated per node,
@@-- (that's an option if the intent is to generate only one file per system)
@@-- Specify the file name for a partition
@@-- @_Partition_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@_LOWER:Partition_Name_@_rtems_ada.gpr
@@-- Specify the file name for the complete system (including nodes)
@@-- (no template tag)
@@-- Specify the file name for a thread
@@-- @_Thread_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@@-- The following tags are available in this template:
@@--
@@-- @_Node_Name_@ : Name of the node from deployment view
@@-- @_Partition_Names_@ : Tag listing the partitions in this node
@@-- @_Partitions_@ : List of rendered code for partitions
@@-- @_CPU_Name_@, _Platform_@, _Classifier_@, _Ada_Runtime_@ : Info about CPU
@@-- The following tags are available in this template:
@@--
@@-- @_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@ : Vector Tag: list of block (user functions) names
@@-- @_Block_Languages@ : |_ Corresponding implementation language
@@-- @_Coverage_@ : True if user requested code coverage enable
@@-- @_Package_Name_@ : AADL Package name for the target (e.g. ocarina_porocessors_x86)
@@-- @_CPU_Name_@ : CPU Name (e.g. x86_linux)
@@-- @_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
@@-- @_Ada_Runtime_@ : Set if CPU_Platform = PLATFORM_GNAT_RUNTIME
@@-- @_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)
-- Node name : @_Name_@
-- Execution platform : @_CPU_Platform_@
project @_CAPITALIZE:Name_@_RTEMS_Ada is
type Build_Type is ("Debug", "Release");
Build : Build_Type := external ("CFG", "Debug");
for Create_Missing_Dirs use "True";
for Object_Dir use "obj_rtems_with_ada";
for Exec_Dir use "../../binaries";
for Languages use ("Ada", "C");
for Main use ("main.c");
package Compiler is
Common_C_Switches :=
("-Wall",
"-Wextra",
"-g",
"-fdiagnostics-show-option",
"-Wcast-align",
"-Wswitch",
"-Wmissing-prototypes",
"-Wimplicit-function-declaration",
"-Wstrict-prototypes",
"-Wnested-externs");
case Build is
when "Release" =>
for Default_Switches ("C") use Common_C_Switches & ("-O2", "-DNDEBUG");
when "Debug" =>
for Default_Switches ("C") use Common_C_Switches & ("-D__PO_HI_USE_VCD=1");
end case;
end Compiler;
package Builder is
for Executable_Suffix use ".exe";
for Executable ("main.c") use "@_Name_@_leon3_rtems";
end Builder;
-- following to be updated with all relevant source dirs
for Source_Dirs use
(".",
"../deploymentview_final/polyorb-hi-c/src",
"../deploymentview_final/polyorb-hi-c/include",
"../../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@@
"ada_code_startup",
"../deploymentview_final/@_LOWER:Name_@")
& external_as_list("ADA_INCLUDE_PATH", ":");
-- These files are not needed to use POHIC: don' t compile them
for Excluded_Source_Files use
("cheddar_schedule.cc",
"cheddar_schedule.hh",
"cheddar_types.hh",
"config.c",
"config_leon4_n2x.c",
"grspw_api.c",
"grspw_pkt_lib.c",
"hyperperriod_config.hh",
"po_hi_driver_drvmgr_common.c",
"po_hi_driver_exarm.c",
"po_hi_driver_exarm_ni_6071e_analog.c",
"po_hi_driver_exarm_ni_6071e_digital.c",
"po_hi_driver_keyboard.c",
"po_hi_driver_leon_eth.c",
"po_hi_driver_leon_serial.c",
"po_hi_driver_linux_serial.c",
"po_hi_driver_rasta_1553_brmlib.c",
"po_hi_driver_rasta_1553.c",
"po_hi_driver_rasta_common.c",
"po_hi_driver_rasta_serial.c",
"po_hi_driver_rasta_spacewire.c",
"po_hi_driver_rtems_drvmgr_ethernet.c",
"po_hi_driver_rtems_drvmgr_serial.c",
"po_hi_driver_rtems_drvmgr_spacewire.c",
"po_hi_driver_rtems_ne2000.c",
"po_hi_driver_serial_common.c",
"po_hi_driver_sockets.c",
"po_hi_driver_stardundee.c",
"po_hi_driver_usbbrick_spacewire.c",
"po_hi_driver_xc4v_fpga.c",
"po_hi_giop.c",
"po_hi_gprof_rtems_leon.c",
"po_hi_lua.c",
"po_hi_monitor.c",
"po_hi_simulink.c",
"po_hi_storage.c",
"remote_configuration.cc",
"spwrouter_custom_config.c",
"star_dundee_api.c",
"trace_manager.c",
"trace_manager.cc",
"um_threads.c");
end @_CAPITALIZE:Name_@_RTEMS_Ada;
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the interface
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_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
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the interface
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_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
@@-- The following tags are available in this template:
@@--
@@-- @_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)
@@-- @_Partition_Names_@ : Vector Tag of partition names
@@-- @_Partition_Node_@ : |_ Corresponding node name
@@-- @_Partition_CPU_@ : |_ Corresponding CPU name
@@-- @_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
@@-- 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)
@@-- The following tags are available in this template:
@@--
@@-- @_Thread_Name_@ : Thread name
@@-- @_Entry_Port_Name_@ : Name of the PI
@@-- @_RCM_@ : One of "CYCLIC_OPERATION", "SPORADIC_OPERATION"
@@-- @_Pro_Block_Name_@ : Name of the protected function
@@-- @_Node_Name_@ : Name of the deployment node
@@-- @_Remote_Threads_@ : Vector tag: output remote thread list
@@-- @_RI_Port_Name_@ : |_ Corresponding local RI name
@@-- @_Remote_PIs_@ : |_ Associated PI Name
@@-- @_Remote_PI_Sorts_@ : |_ Optional param type of the remote thread
@@-- @_Remote_PI_Modules_@ : |_ Asn1 module of the optional param type
@@-- Tags related to the PI that is at the origin of the thread creation:
@@-- @_Name_@, @_Kind_@, @_Parent_Function_@ : shoud be useless here
@@-- @_Param_Names_@, _Types_@, _ASN1_Modules, _Encodings_@, _Directions_@ : param vector tag
@@-- @_Period_@, @_WCET_@, @_Queue_Size_@ : relevant here
@@-- @_IF_Property_Names_@, _Values_@ : user properties (vector tag)
@@--
@@-- Matrix of output ports: Remote thread/corresponding remote PI @_Name_@
@@-- The following boolean tags are available to decide if the file
@@-- shall be generated or not:
@@-- Filename_Is_Present
@@-- Skeletons
@@-- Glue
@@-- Use_POHIC
@@-- Debug
@@-- No_Stdlib
@_Use_POHIC_@
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