partition.tmplt 6.35 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@@-- 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)
Maxime Perrotin's avatar
Maxime Perrotin committed
24
25
26
27
28
29
@@-- @_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)
30
31
32
33
34
35
36
--  Node name          : @_Name_@
--  Execution platform : @_CPU_Platform_@
project @_CAPITALIZE:Name_@ is

   type Build_Type is ("Debug", "Release");
   Build : Build_Type := external ("CFG", "Debug");

37
38
@@-- Not all systems use Ada so we must not always include Ada dataview folder
@@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
39
@@IF@@ @_LOWER:Block_Languages_@ = sdl or @_LOWER:Block_Languages_@ = ada
40
41
42
@@SET@@ Need_Ada = TRUE
@@END_IF@@
@@END_TABLE@@
43
44
   --  following to be updated with all relevant source dirs
   for Source_Dirs use
Maxime Perrotin's avatar
Maxime Perrotin committed
45
      ("@_LOWER:Name_@",
46
47
48
49
@@IF@@ @_VP_Name_@ = "" and @_In_Port_Names'Length_@ > 0
@@-- Detect distributed systems (no virtual processor) - add DriversConfig folder
       "../DriversConfig",
@@END_IF@@ 
50
51
52
       "../deploymentview_final/polyorb-hi-c/src",
       "../deploymentview_final/polyorb-hi-c/include",
       "../../dataview/C",
53
@@IF@@ @_Need_Ada_@ = TRUE
54
       "../../dataview/Ada",
55
@@END_IF@@
56
@@TABLE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
57
58
59
@@IF@@ @_LOWER:Block_Languages_@ = sdl
       "../../@_LOWER:Block_Names_@/SDL/code",
       "../../@_LOWER:Block_Names_@/SDL/wrappers",
60
@@ELSE@@
Maxime Perrotin's avatar
Maxime Perrotin committed
61
62
       "../../@_LOWER:Block_Names_@/@_Block_Languages_@/src",
       "../../@_LOWER:Block_Names_@/@_Block_Languages_@/wrappers",
63
64
65
66
67
68
69
70
@@END_IF@@
@@END_TABLE@@
       "../deploymentview_final/@_LOWER:Name_@")
        & external_as_list("ADA_INCLUDE_PATH", ":");

   for Object_Dir use "obj";
   for Exec_Dir   use "../../binaries";

Maxime Perrotin's avatar
Maxime Perrotin committed
71
@@IF@@ @_Need_Ada_@ = TRUE
72
   for Languages use ("Ada", "C");
Maxime Perrotin's avatar
Maxime Perrotin committed
73
74
75
@@ELSE@@
   for Languages use ("C");
@@END_IF@@
76
77
78
79
80
81
82
83
84

   for Main use ("main.c");

   --  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",
Maxime Perrotin's avatar
Maxime Perrotin committed
85
86
87
88
89
90
       "marshallers.c",  -- only for distributed systems
@@IF@@ @_In_Port_Names'Length_@ = 0 and @_Out_Port_Names'Length_@ = 0 and @_Thread_Src_Port'Length_@ = 0
       "po_hi_gqueue.c",
       "po_hi_transport.c",
       "po_hi_marshallers.c", 
       "po_hi_semaphore.c",
91
       "po_hi_monitor.c",
Maxime Perrotin's avatar
Maxime Perrotin committed
92
@@END_IF@@
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
       "config_leon3_drvmgr.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_simulink.c",
       "po_hi_storage.c",
       "remote_configuration.cc",
       "spwrouter_custom_config.c",
       "star_dundee_api.c",
       "trace_manager.c",
       "um_threads.c");


   package Compiler is
      case Build is
         when "Release" =>
            for Default_Switches ("C") use
               ("-g",
                "-O2",
                "-DTARGET=native",
                "-DPOSIX",
                "-D_POSIX_SOURCE",
                "-D_GNU_SOURCE",
                "-Wall",
                "-Wextra",
                "-fdiagnostics-show-option",
                "-Wcast-align",
                "-Wswitch");
         when "Debug" =>
            for Default_Switches ("C") use
               ("-g",
                "-DTARGET=native",
                "-DPOSIX",
                "-D_POSIX_SOURCE",
                "-D_GNU_SOURCE",
                "-Wall",
                "-Wextra",
                "-fdiagnostics-show-option",
                "-Wcast-align",
                "-Wswitch");
      end case;
   end Compiler;

   package Linker is
      for Default_Switches ("C") use
         ("-g",
          "-lrt",
          "-lpthread",
          "-lm",
          "-Wl,-gc-sections");
   end Linker;
170
171
172
173

   package Builder is
      for Executable ("main.c") use "@_Name_@";
   end Builder;
174
175
176
177
   
end @_CAPITALIZE:Name_@;