Commit 21e4992b authored by Laura Alexandra Sequeira Gouveia's avatar Laura Alexandra Sequeira Gouveia
Browse files

Update handling of Zynq build, featuring RTEMS and Bambu build calls.

Now features an Aggregated project featuring hte separate RTEMS and Bambu compilation steps.
Currently missing Vivado calls and linking step for VHD.
parent 39b4e1a1
......@@ -43,11 +43,10 @@ air:
@@END_TABLE@@
zynq:
# No linker step defined for Bambu build yet, leaving a separate link step for RTEMS only. Should be removed when Vivado calls are defined.
@@TABLE@@
# We need to compile and link separately because the linker script must
# be copied to the obj folder. Path cannot be set manually with -T
gprbuild -p -v --config=zynq_rtems.cgpr -P @_LOWER:Partition_Names_@_zynq_rtems.gpr -XCFG="Debug" -cargs:C -DSTATIC=""
gprbuild -p -v -f --config=zynq_rtems.cgpr -P @_LOWER:Partition_Names_@_zynq_bambu.gpr -XCFG="Debug" -cargs:Simulink -DSTATIC=""
gprbuild -c -p -v --config=zynq_rtems.cgpr -P @_LOWER:Partition_Names_@_zynq.gpr -XCFG="Debug" -cargs:C -DSTATIC=""
gprbuild -l -p -v --config=zynq_rtems.cgpr -P @_LOWER:Partition_Names_@_zynq_rtems.gpr -XCFG="Debug" -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
zynq_bambu.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)
@@-- @_CPU_Family_@ : e.g. gr740 or x86
@@-- @_CPU_Instance_@ : e.g. rtems51_posix or 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)
@@-- @_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_Thread_Name_@ : |_ corresponding thread inside the partition
@@-- @_Out_Port_Type_Name_@ : |_ corresponding parameter type name (optional)
-- Node name : @_Name_@
-- Execution platform : @_CPU_Platform_@
-- Generic gprbuild configuration file for rtems5 with Ada support for leon3
configuration project ZYNQ_RTEMS is
package Compiler is
for Driver ("C") use "arm-rtems5-gcc";
for Driver ("Ada") use "arm-rtems5-gcc";
for Driver ("C++") use "arm-rtems5-g++";
for Driver ("Simulink") use "bambu";
for Leading_Required_Switches ("C") use ("-c");
for Leading_Required_Switches ("C++") use ("-c");
for Required_Switches("Ada") use
("-c",
"-x",
"ada",
"-gnatA");
Common_C_Switches :=
("--pipe",
"-DRTEMS_POSIX",
"-DTARGET=zynq",
"-mthumb",
"-march=armv7-a",
"-mfpu=neon",
"-mfloat-abi=hard",
"-mtune=cortex-a9",
"-B/opt/rtems-5.1-2019.12.03/arm-rtems5/xilinx_zynq_zc706/lib",
"-specs=bsp_specs",
"-qrtems");
for Required_Switches("C") use Common_C_Switches;
for Required_Switches("C++") use Common_C_Switches;
for Object_File_Suffix ("C") use ".o";
for Object_File_Suffix ("C++") use ".o";
for Object_File_Suffix ("Ada") use ".o";
for Dependency_Switches ("C") use ("-Wp,-MD,");
for Dependency_Switches ("C++") use ("-Wp,-MD,");
for Dependency_Switches ("Ada") use ("-MMD","-MF","");
for Include_Switches ("C") use ("-I");
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 Body_Suffix ("C++") use ".cc";
for Spec_Suffix ("Simulink") use ".h";
for Body_Suffix ("Simulink") use ".c";
for Dot_Replacement use "-";
end Naming;
@@-- for Archive_Builder use ("arm-rtems5-ar" , "cr");
@@-- no linker step defined yet, leaving as placeholder
@@-- package Linker is
@@-- for Driver use "arm-rtems5-gcc";
@@-- Common_C_Linker_Switches :=
@@-- ("--pipe",
@@-- "-mthumb",
@@-- "-march=armv7-a",
@@-- "-mfpu=neon",
@@-- "-mfloat-abi=hard",
@@-- "-mtune=cortex-a9",
@@-- "-g",
@@-- "-fdiagnostics-show-option",
@@-- "-ffunction-sections",
@@-- "-B/opt/rtems-5.1-2019.12.03/arm-rtems5/xilinx_zynq_zc706/lib",
@@-- "-specs=bsp_specs",
@@-- "-qrtems",
@@-- "-lm",
@@-- "-lstdc++",
@@-- "-Wl,-gc-sections");
@@--
@@-- for Default_Switches ("C") use Common_C_Linker_Switches;
@@-- for Default_Switches ("C++") use Common_C_Linker_Switches;
@@-- for Default_Switches ("Ada") use
@@-- ("--pipe",
@@-- "-g",
@@-- "-B/opt/rtems-5.1-2019.12.03/arm-rtems5/xilinx_zynq_zc706/lib",
@@-- "-specs=bsp_specs",
@@-- "-qrtems",
@@-- "-lm",
@@-- "-lgnat");
@@-- end Linker;
end ZYNQ_RTEMS;
@@-- 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_@
......@@ -7,6 +7,78 @@
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
project @_CAPITALIZE:Node_Name_@_Zynq_Bambu_@_LOWER:Name_@ is
@@IF@@ @_LOWER:Language_@ = simulink
@_STRIP:Protected_PIs_@
type Build_Type is ("Debug", "Release");
Build : Build_Type := external ("CFG", "Debug");
-- for Create_Missing_Dirs use "True"; (not supported in Debian 9, use -p instead)
for Object_Dir use "Bambu";
for Exec_Dir use "../../binaries";
for Languages use ("Simulink");
for Main use (
"@_STRIP:Unprotected_PIs_@.c"
);
package Compiler is
Common_Bambu_Switches :=
("--compiler=I386_CLANG4",
"--experimental-setup=BAMBU-BALANCED",
"--no-iob",
"--clock-period=40",
"-funroll-loops",
"-fno-inline",
"--speculative-sdc-scheduling",
"-DSTATIC="" ",
"--generate-interface=INFER",
"-v4",
"--do-not-expose-globals",
"-wH",
"--panda-parameter=none-registered-ptrdefault=1",
"-I../../../dataview/C");
for Switches ("@_STRIP:Unprotected_PIs_@.c") use Common_Bambu_Switches &
("-I../../../@_LOWER:Name_@/SIMULINK/src",
"-I../../../@_LOWER:Name_@/SIMULINK/wrappers",
"--clock-name=clock_@_STRIP:Unprotected_PIs_@",
"--reset-name=reset_@_STRIP:Unprotected_PIs_@",
"--start-name=start_@_STRIP:Unprotected_PIs_@",
"--done-name=finish_@_STRIP:Unprotected_PIs_@",
"--top-fname=bambu_@_STRIP:Unprotected_PIs_@",
"../../../@_LOWER:Name_@/SIMULINK/wrappers/@_STRIP:Unprotected_PIs_@_bambu.c");
case Build is
when "Release" =>
for Default_Switches ("Simulink") use Common_Bambu_Switches & ("-O2")
& external_as_list("USER_CFLAGS", "");
when "Debug" =>
for Default_Switches ("Simulink") use Common_Bambu_Switches & ("")
& external_as_list("USER_CFLAGS", "");
end case;
end Compiler;
package Linker is
for Default_Switches ("Simulink") use
external_as_list("USER_LDFLAGS", "");
end Linker;
package Builder is
for Executable_Suffix use ".bit";
for Executable ("@_STRIP:Unprotected_PIs_@.c") use "@_Name_@_bambu";
end Builder;
-- following to be updated with all relevant source dirs
for Source_Dirs use
(
"../../@_LOWER:Name_@/SIMULINK/src"
);
for Excluded_Source_Files use
("ert_main.c");
@@END_IF@@
end @_CAPITALIZE:Node_Name_@_Zynq_Bambu_@_LOWER:Name_@;
@@-- 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
zynq_bambu_@_LOWER:Block_Name_@.gpr
......@@ -40,88 +40,18 @@
@@SET@@ Need_Ada = TRUE
@@END_IF@@
@@END_TABLE@@
project @_CAPITALIZE:Name_@_Zynq_Bambu is
type Build_Type is ("Debug", "Release");
Build : Build_Type := external ("CFG", "Debug");
-- for Create_Missing_Dirs use "True"; (not supported in Debian 9, use -p instead)
for Object_Dir use "Bambu";
for Exec_Dir use "../../binaries";
@@IF@@ @_Need_Ada_@ = TRUE
for Languages use ("Simulink");
@@ELSE@@
for Languages use ("Simulink");
@@END_IF@@
for Main use (
"@_STRIP:Blocks_@.c");
package Compiler is
Common_Bambu_Switches :=
("--compiler=I386_CLANG4",
"--experimental-setup=BAMBU-BALANCED",
"--no-iob",
"--clock-period=40",
"-funroll-loops",
"-fno-inline",
"--speculative-sdc-scheduling",
@@-- "-DSTATIC="" ",
"--generate-interface=INFER",
"-v4",
"--do-not-expose-globals",
"-wH",
"--panda-parameter=none-registered-ptrdefault=1",
@@TABLE@@
@@IF@@ @_LOWER:Block_Languages_@ = simulink
"-I../../../@_LOWER:Block_Names_@/SIMULINK/src",
"-I../../../@_LOWER:Block_Names_@/SIMULINK/wrappers",
@@END_IF@@
@@END_TABLE@@
@@TABLE@@
@@IF@@ @_LOWER:Block_Languages_@ = simulink
"../../../@_LOWER:Block_Names_@/SIMULINK/wrappers/@_STRIP:Blocks_@_bambu.c",
@@END_IF@@
@@END_TABLE@@
"-I../../../dataview/C");
case Build is
when "Release" =>
for Default_Switches ("Simulink") use Common_Bambu_Switches & ("-O2")
& external_as_list("USER_CFLAGS", "");
when "Debug" =>
for Default_Switches ("Simulink") use Common_Bambu_Switches & ("")
& external_as_list("USER_CFLAGS", "");
end case;
end Compiler;
package Linker is
for Default_Switches ("Simulink") use
external_as_list("USER_LDFLAGS", "");
end Linker;
package Builder is
for Executable_Suffix use ".bit";
for Executable ("@_STRIP:Blocks_@.c") use "@_Name_@_bambu";
end Builder;
-- following to be updated with all relevant source dirs
for Source_Dirs use
(
aggregate project @_CAPITALIZE:Name_@_Zynq_Bambu is
for Project_Files use (
@@INLINE(,)@@
@@TABLE@@
@@IF@@ @_LOWER:Block_Languages_@ = simulink
"../../@_LOWER:Block_Names_@/SIMULINK/src"
@@-- "../../@_LOWER:Block_Names_@/SIMULINK/wrappers",
"zynq_bambu_@_LOWER:Block_Names_@.gpr"
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
);
for Excluded_Source_Files use
("ert_main.c");
end @_CAPITALIZE:Name_@_Zynq_Bambu;
......@@ -7,4 +7,4 @@
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@_LOWER:Name_@
@_STRIP:LOWER:Name_@
Generate a gpr configuration file for RTEMS with Ada support (POHIC)
Supports Markdown
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