ocarina-backends-po_hi_c.adb 22.7 KB
Newer Older
1
2
3
4
5
6
7
8
------------------------------------------------------------------------------
--                                                                          --
--                           OCARINA COMPONENTS                             --
--                                                                          --
--             O C A R I N A . B A C K E N D S . P O _ H I _ C              --
--                                                                          --
--                                 B o d y                                  --
--                                                                          --
9
--    Copyright (C) 2008-2009 Telecom ParisTech, 2010-2020 ESA & ISAE.      --
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--                                                                          --
-- Ocarina  is free software; you can redistribute it and/or modify under   --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
-- sion. Ocarina is distributed in the hope that it will be useful, but     --
-- WITHOUT ANY WARRANTY; without even the implied warranty of               --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     --
--                                                                          --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception,   --
-- version 3.1, as published by the Free Software Foundation.               --
--                                                                          --
-- You should have received a copy of the GNU General Public License and    --
-- a copy of the GCC Runtime Library Exception along with this program;     --
-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
-- <http://www.gnu.org/licenses/>.                                          --
26
--                                                                          --
jhugues's avatar
jhugues committed
27
28
--                 Ocarina is maintained by the TASTE project               --
--                      (taste-users@lists.tuxfamily.org)                   --
29
30
31
32
--                                                                          --
------------------------------------------------------------------------------

with GNAT.OS_Lib;
33
with Ocarina.Output;
34

35
36
with GNAT.Directory_Operations;

37
38
39
with Ocarina.Instances;
with Ocarina.Backends.Expander;
with Ocarina.Backends.Messages;
40
41
42
43
with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Entities;
44
with Ocarina.Backends.C_Tree.Generator;
julien.delange's avatar
julien.delange committed
45
with Ocarina.Backends.C_Tree.Nodes;
46
47
48
49
50
51
52
53
54
55
56
57
58
59
with Ocarina.Backends.PO_HI_C.Activity;
with Ocarina.Backends.PO_HI_C.Main;
with Ocarina.Backends.PO_HI_C.Naming;
with Ocarina.Backends.PO_HI_C.Runtime;
with Ocarina.Backends.PO_HI_C.Deployment;
with Ocarina.Backends.PO_HI_C.Request;
with Ocarina.Backends.C_Common.Types;
with Ocarina.Backends.C_Common.Subprograms;
with Ocarina.Backends.PO_HI_C.Marshallers;
with Ocarina.Backends.Utils;
with Ocarina.Backends.Build_Utils;
with Ocarina.Backends.Execution_Utils;
with Ocarina.Backends.Execution_Tests;
with Ocarina.Backends.Properties;
julien.delange's avatar
julien.delange committed
60
with Ocarina.Backends.ASN1;
61

62
with Ocarina.Namet;
63
64
65
66
67

package body Ocarina.Backends.PO_HI_C is

   use GNAT.OS_Lib;

68
69
   use Ocarina.Namet;
   use Ocarina.Output;
70

71
72
   use GNAT.Directory_Operations;

73
   use Ocarina.Backends.Properties;
74
75
76
   use Ocarina.ME_AADL;
   use Ocarina.ME_AADL.AADL_Instances.Nodes;
   use Ocarina.ME_AADL.AADL_Instances.Entities;
77
78
79
80
81
82
83
   use Ocarina.Backends.Messages;
   use Ocarina.Backends.Utils;
   use Ocarina.Backends.Expander;
   use Ocarina.Instances;
   use Ocarina.Backends.Build_Utils;
   use Ocarina.Backends.Execution_Tests;

84
85
   package AAN renames Ocarina.ME_AADL.AADL_Instances.Nodes;
   package AAU renames Ocarina.ME_AADL.AADL_Instances.Nutils;
julien.delange's avatar
julien.delange committed
86
87
   package CTN renames Ocarina.Backends.C_Tree.Nodes;

88
89
90
91
92
93
   procedure Visit_Architecture_Instance (E : Node_Id);
   --  Most top level visitor routine. E is the root of the AADL
   --  instance tree. The procedure does a traversal for each
   --  compilation unit to be generated.

   procedure PolyORB_HI_C_Makefile
94
95
96
     (Appli_Name              : Name_Id;
      Node_Name               : Name_Id;
      Execution_Platform      : Supported_Execution_Platform := Platform_None;
97
      Execution_Platform_Name : Name_Id;
98
99
      USER_CFLAGS             : Name_Id;
      USER_LDFLAGS            : Name_Id;
100
101
102
103
104
105
106
107
108
109
110
111
      Transport_API           : Supported_Transport_APIs;
      Ada_Sources             : Name_Tables.Instance;
      Asn_Sources             : Name_Tables.Instance;
      C_Sources               : Name_Tables.Instance;
      C_Libraries             : Name_Tables.Instance;
      User_Source_Dirs        : Name_Tables.Instance;
      Use_Transport           : Boolean;
      Use_Simulink            : Boolean;
      Simulink_Directory      : Name_Id;
      Simulink_Node           : Name_Id;
      Use_Scade               : Boolean;
      Scade_Directory         : Name_Id);
112
113
114
115
116
117

   ---------------------------
   -- PolyORB_HI_C_Makefile --
   ---------------------------

   procedure PolyORB_HI_C_Makefile
118
119
120
     (Appli_Name              : Name_Id;
      Node_Name               : Name_Id;
      Execution_Platform      : Supported_Execution_Platform := Platform_None;
121
      Execution_Platform_Name : Name_Id;
122
123
      USER_CFLAGS             : Name_Id;
      USER_LDFLAGS            : Name_Id;
124
125
126
127
128
129
130
131
132
133
134
135
      Transport_API           : Supported_Transport_APIs;
      Ada_Sources             : Name_Tables.Instance;
      Asn_Sources             : Name_Tables.Instance;
      C_Sources               : Name_Tables.Instance;
      C_Libraries             : Name_Tables.Instance;
      User_Source_Dirs        : Name_Tables.Instance;
      Use_Transport           : Boolean;
      Use_Simulink            : Boolean;
      Simulink_Directory      : Name_Id;
      Simulink_Node           : Name_Id;
      Use_Scade               : Boolean;
      Scade_Directory         : Name_Id)
136
   is
137
138
      pragma Unreferenced (Transport_API, C_Sources, Ada_Sources, C_Libraries);
      O_File : Name_Id;
139
   begin
140
      if Use_ASN1_Deployment then
141
142
         Write_Str ("ASN_OBJS += asn1_deployment.o ");
         if Length (Asn_Sources) > 0 then
143
            for J in Name_Tables.First .. Name_Tables.Last (Asn_Sources) loop
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162

               Get_Name_String (Asn_Sources.Table (J));
               Name_Buffer (Name_Len - 2) := 'o';

               Set_Str_To_Name_Buffer
                 (Base_Name (Name_Buffer (1 .. Name_Len - 2)));
               O_File := Name_Find;

               Write_Str ("");
               Write_Name (O_File);

               exit when J = Name_Tables.Last (Asn_Sources);

               Write_Space;
            end loop;
         end if;
         Write_Eol;
      end if;

163
164
165
166
167
168
      if Appli_Name /= No_Name then
         Write_Str ("MAINAPP = ");
         Write_Name (Appli_Name);
         Write_Eol;
      end if;

169
170
171
172
173
174
175
176
177
178
179
180
      if USER_CFLAGS /= No_Name then
         Write_Str ("USER_CFLAGS = ");
         Write_Name (USER_CFLAGS);
         Write_Eol;
      end if;

      if USER_LDFLAGS /= No_Name then
         Write_Str ("USER_LDFLAGS = ");
         Write_Name (USER_LDFLAGS);
         Write_Eol;
      end if;

181
182
183
184
185
186
187
      Write_Str ("BINARY = ");
      Write_Name (Node_Name);
      Write_Eol;

      Write_Str ("TARGET = ");

      case Execution_Platform is
188
         when Platform_Native =>
189
190
            Write_Str ("native");

191
192
193
194
195
196
197
         when Platform_None =>
            if Execution_Platform_Name /= No_Name then
               Write_Name (Execution_Platform_Name);
            else
               Write_Str ("native");
            end if;

198
199
200
         when Platform_Native_Compcert =>
            Write_Str ("compcert");

201
202
203
         when Platform_Bench =>
            Write_Str ("bench");

204
205
206
         when Platform_LEON_RTEMS =>
            Write_Str ("leon.rtems");

207
208
209
         when Platform_LEON_RTEMS_POSIX =>
            Write_Str ("leon.rtems_posix");

210
211
212
         when Platform_X86_LINUXTASTE =>
            Write_Str ("x86.linuxtaste");

213
214
215
216
217
218
         when Platform_LINUX64 =>
            Write_Str ("linux64");

         when Platform_LINUX32 =>
            Write_Str ("linux32");

219
220
         when Platform_LINUX_DLL =>
            Write_Str ("linux_dll");
221

222
223
224
         when Platform_WIN32 =>
            Write_Str ("win32");

225
226
227
         when Platform_LEON3_XM3 =>
            Write_Str ("leon3-xm3");

jdelange's avatar
   
jdelange committed
228
229
230
         when Platform_LEON3_SCOC3 =>
            Write_Str ("leon3-scoc3");

231
232
233
234
235
236
         when Platform_LINUX32_XENOMAI_NATIVE =>
            Write_Str ("linux32-xenomai-native");

         when Platform_LINUX32_XENOMAI_POSIX =>
            Write_Str ("linux32-xenomai-posix");

yoogx's avatar
yoogx committed
237
238
239
         when Platform_AIR =>
            Write_Str ("air");

Rafal Babski's avatar
Rafal Babski committed
240
241
242
         when Platform_MSP430_FREERTOS =>
            Write_Str ("msp430_freertos");

243
         when others =>
244
245
246
            Display_Error
              ("Unsupported platform " & Execution_Platform'Img,
               Fatal => True);
247
248
249
250
251
252
253
254
255
256
      end case;

      Write_Eol;
      Write_Str ("NEED_TRANSPORT = ");
      if Use_Transport then
         Write_Line ("yes");
      else
         Write_Line ("no");
      end if;

257
258
259
260
261
      if Add_Performance_Analysis then
         Write_Str ("USE_GPROF = yes");
         Write_Eol;
      end if;

262
263
264
265
266
      if Generate_ASN1_Deployment then
         Write_Str ("USE_ASN1_DEPLOYMENT = yes");
         Write_Eol;
      end if;

267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
      if Use_Simulink then
         Write_Str ("SIMULINK_DIR = ");
         Write_Name (Simulink_Directory);
         Write_Eol;

         Write_Str ("SIMULINK_NODE = ");
         Write_Name (Simulink_Node);
         Write_Eol;
      end if;

      if Use_Scade then
         Write_Str ("SCADE_DIR = ");
         Write_Name (Scade_Directory);
         Write_Eol;
      end if;

283
284
285
286
287
288
      --  The following syntax escapes whitespace in the path

      --      Write_Line ("RUNTIME_PATH=$(shell echo """
      --      & Get_Runtime_Path ("polyorb-hi-c")
      --                    & """ | sed 's/ /\\ /g')");

289
290
291
292
      Write_Line
        ("BUILD_DIR:=$(shell dirname " &
           "$(abspath $(lastword $(MAKEFILE_LIST))))");
      Write_Line ("RUNTIME_PATH=$(BUILD_DIR)/../polyorb-hi-c");
293
294

      Write_Str ("USER_SOURCES_DIRS=");
295
296
297
298
299
300

      if Scenario_Dir /= null then
         Write_Space;
         Write_Str ("""-I" & Scenario_Dir.all & """");
      end if;

301
      if Length (User_Source_Dirs) > 0 then
302
         for J in Name_Tables.First .. Name_Tables.Last (User_Source_Dirs) loop
303
            Write_Space;
yoogx's avatar
yoogx committed
304
            Write_Str ("""-I");
305
306
            Write_Name
              (Remove_Directory_Separator (User_Source_Dirs.Table (J)));
yoogx's avatar
yoogx committed
307
            Write_Str ("""");
308
309
310
311
312
313
314
315
316
317
            exit when J = Name_Tables.Last (User_Source_Dirs);

            Write_Space;
         end loop;
         Write_Eol;
      else
         Write_Str (".");
         Write_Eol;
      end if;

318
319
320
321
322
323
324
      Write_Str ("ASN_SOURCES=");

      if Generate_ASN1_Deployment then
         Write_Str ("../asn1_deployment.asn ");
      end if;

      if Length (Asn_Sources) > 0 then
325
         for J in Name_Tables.First .. Name_Tables.Last (Asn_Sources) loop
326
327
328
329
330
331
332
333
334
335
336
337
338
            Write_Str ("");
            Write_Name (Asn_Sources.Table (J));

            exit when J = Name_Tables.Last (Asn_Sources);

            Write_Space;
         end loop;

         Write_Eol;
      else
         Write_Eol;
      end if;

339
340
341
      Write_Line ("include $(RUNTIME_PATH)/make/Makefile.common");
   end PolyORB_HI_C_Makefile;

342
343
344
345
   ------------------------------------
   -- Generate_Doxygen_Configuration --
   ------------------------------------

346
   procedure Generate_Doxygen_Configuration (My_System : Node_Id) is
347
      procedure Visit_Architecture_Instance (E : Node_Id);
348
349
350
      procedure Visit_Component_Instance (E : Node_Id);
      procedure Visit_System_Instance (E : Node_Id);
      procedure Visit_Process_Instance (E : Node_Id);
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383

      -----------
      -- Visit --
      -----------

      procedure Visit (E : Node_Id) is
      begin
         case AAN.Kind (E) is
            when AAN.K_Architecture_Instance =>
               Visit_Architecture_Instance (E);

            when AAN.K_Component_Instance =>
               Visit_Component_Instance (E);

            when others =>
               null;
         end case;
      end Visit;

      ---------------------------------
      -- Visit_Architecture_Instance --
      ---------------------------------

      procedure Visit_Architecture_Instance (E : Node_Id) is
      begin
         Visit (AAN.Root_System (E));
      end Visit_Architecture_Instance;

      ------------------------------
      -- Visit_Component_Instance --
      ------------------------------

      procedure Visit_Component_Instance (E : Node_Id) is
384
385
         Category : constant Component_Category :=
           Get_Category_Of_Component (E);
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
      begin
         case Category is
            when CC_System =>
               Visit_System_Instance (E);

            when CC_Process =>
               Visit_Process_Instance (E);

            when others =>
               null;
         end case;
      end Visit_Component_Instance;

      ----------------------------
      -- Visit_Process_Instance --
      ----------------------------

      procedure Visit_Process_Instance (E : Node_Id) is
yoogx's avatar
yoogx committed
404
         S     : constant Node_Id := AAN.Parent_Subcomponent (E);
405
         Fd    : File_Descriptor;
yoogx's avatar
yoogx committed
406
         Rpath : constant String  := Get_Runtime_Path ("polyorb-hi-c");
407
408
409
410
411
412
413
414
415
416
417
      begin
         Enter_Directory (Normalize_Name (AAN.Name (AAN.Identifier (S))));

         Fd := Create_File ("doxygen.cfg", Text);
         if Fd = Invalid_FD then
            raise Program_Error;
         end if;

         Set_Output (Fd);

         Write_Str ("PROJECT_NAME           = ");
418
         Write_Name (Normalize_Name (AAN.Name (AAN.Identifier (S))));
419
420
421
422
423
424
         Write_Eol;
         Write_Line ("OUTPUT_DIRECTORY       = generated-documentation");
         Write_Line ("GENERATE_LATEX         = YES");
         Write_Line ("GENERATE_MAN           = YES");
         Write_Line ("GENERATE_RTF           = YES");
         Write_Line ("CASE_SENSE_NAMES       = NO");
425
426
427
428
429
430
         Write_Str ("INPUT                  = . ");
         Write_Str (Rpath);
         Write_Eol;
         Write_Line ("SOURCE_BROWSER         = YES");
         Write_Line ("OPTIMIZE_OUTPUT_FOR_C  = YES");
         Write_Line ("GENERATE_TREEVIEW      = YES");
431
         Write_Line ("QUIET                  = YES");
432
         Write_Line ("HAVE_DOT               = YES");
433
         Write_Line ("JAVADOC_AUTOBRIEF      = YES");
434
         Write_Line ("EXTRACT_ALL            = YES");
435
436
437
438
439
440
         Write_Line ("EXTRACT_PRIVATE        = YES");
         Write_Line ("EXTRACT_STATIC         = YES");
         Write_Line ("TYPEDEF_HIDES_STRUCT   = YES");
         Write_Line ("INLINE_SOURCES         = YES");
         Write_Line ("REFERENCED_BY_RELATION = YES");
         Write_Line ("REFERENCES_RELATION    = YES");
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
         Write_Line ("SEARCHENGINE           = YES");
         Write_Line ("SERVER_BASED_SEARCH    = NO");
         Write_Line ("SEARCH_INCLUDES        = YES");
         Write_Line ("INCLUDED_BY_GRAPH      = YES");
         Write_Line ("ENABLE_PREPROCESSING   = YES");
         Write_Line ("OUTPUT_LANGUAGE        = English");
         Write_Line ("BRIEF_MEMBER_DESC      = YES");
         Write_Line ("REPEAT_BRIEF           = YES");
         Write_Line ("RECURSIVE              = YES");
         Write_Line ("EXAMPLE_RECURSIVE      = NO");
         Write_Line ("DIRECTORY_GRAPH        = YES");
         Write_Line ("CLASS_GRAPH            = YES");
         Write_Line ("COLLABORATION_GRAPH    = YES");
         Write_Line ("GROUP_GRAPHS           = YES");
         Write_Line ("INCLUDE_GRAPH          = YES");
         Write_Line ("INCLUDED_BY_GRAPH      = YES");
         Write_Line ("CALL_GRAPH             = YES");
         Write_Line ("CALLER_GRAPH           = YES");
         Write_Line ("GRAPHICAL_HIERARCHY    = YES");
         Write_Line ("DIRECTORY_GRAPH        = YES");
         Write_Line ("DOT_GRAPH_MAX_NODES    = 50");
         Write_Line ("MAX_DOT_GRAPH_DEPTH    = 0");
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
         Write_Eol;

         Close (Fd);
         Set_Standard_Output;

         Leave_Directory;
      end Visit_Process_Instance;

      ---------------------------
      -- Visit_System_Instance --
      ---------------------------

      procedure Visit_System_Instance (E : Node_Id) is
         S : Node_Id;
      begin
478
479
480
481
482
483
484
         if not Present (AAN.Parent_Subcomponent (E)) then
            --  We jump one directory iff the current system denotes
            --  the root system, other systems do not lead to
            --  generated code, they are silent.
            Enter_Directory (Normalize_Name (AAN.Name (AAN.Identifier (E))));
         end if;

485
486
487
488
489
490
491
492
493
494
495
496
         --  Visit all the subcomponents of the system

         if not AAU.Is_Empty (AAN.Subcomponents (E)) then
            S := AAN.First_Node (AAN.Subcomponents (E));
            while Present (S) loop
               --  Visit the component instance corresponding to the
               --  subcomponent S.

               Visit (Corresponding_Instance (S));
               S := AAN.Next_Node (S);
            end loop;
         end if;
497
498
499
500

         if not Present (AAN.Parent_Subcomponent (E)) then
            Leave_Directory;
         end if;
501
      end Visit_System_Instance;
502

503
504
505
506
   begin
      Visit (My_System);
   end Generate_Doxygen_Configuration;

507
508
509
510
511
512
513
514
   --------------
   -- Generate --
   --------------

   procedure Generate (AADL_Root : Node_Id) is
      Instance_Root : Node_Id;
      Success       : Boolean := True;

yoogx's avatar
yoogx committed
515
516
517
      procedure Generate_PolyORB_HI_C_Makefile is new Build_Utils.Makefiles
        .Generate
        (PolyORB_HI_C_Makefile);
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549

   begin
      --  Instantiate the AADL tree

      Instance_Root := Instantiate_Model (AADL_Root);

      --  Expand the AADL instance

      Expand (Instance_Root);

      Visit_Architecture_Instance (Instance_Root);
      --  Abort if the construction of the C tree failed

      if No (C_Root) then
         Display_Error ("Code generation failed", Fatal => True);
      end if;

      --  At this point, we have a valid C tree, we can begin the
      --  generation of C source files.

      --  Enter the output directory

      Enter_Directory (Generated_Sources_Directory);

      if Remove_Generated_Sources then
         Build_Utils.Makefiles.Clean (Instance_Root);

      else
         --  Create the source files

         C_Tree.Generator.Generate (C_Root);

550
551
552
553
         --  Create doxygen configuration files

         Generate_Doxygen_Configuration (Instance_Root);

554
555
556
557
         --  Generate the Makefiles

         Generate_PolyORB_HI_C_Makefile (Instance_Root);

julien.delange's avatar
julien.delange committed
558
         --  If we have to generate the ASN1 deployment file, then
jhugues's avatar
jhugues committed
559
         --  we enter the directory that contains the generated
julien.delange's avatar
julien.delange committed
560
561
562
563
         --  code and invoke directly the ASN1 generator with the
         --  instance root. It should automatically create an .asn1
         --  file that contains deployment/messages informations.

julien.delange's avatar
julien.delange committed
564
565
566
567
568
569
         if Generate_ASN1_Deployment then
            Enter_Directory (CTN.Name (C_Root));
            ASN1.Generate (Instance_Root);
            Leave_Directory;
         end if;

570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
         --  If the user requested to build the applications then we
         --  build it.

         if Compile_Generated_Sources then
            Build_Utils.Makefiles.Build (Instance_Root);
         end if;
      end if;

      --  If the user requested to test the applications then we
      --  test it.

      if Do_Regression_Test or else Do_Coverage_Test then

         --  Execution_Utils package initialization

         Execution_Utils.Init;
         Execution_Utils.Visit (Instance_Root);
         Execution_Tests.Init;

         if Do_Regression_Test then
590
591
592
593
594
            Success :=
              Execute_Regression_Test
                (Scenario_Dir.all,
                 Ref_Map,
                 Integer (Timeout))
595
596
597
598
599
600
601
602
603
604
605
606
607
              and then Success;

            if not Create_Referencial then
               Write_Eol;
               if Success then
                  Write_Line ("--- All regression tests PASSED ---");
               else
                  Write_Line ("--- Regression tests FAILED ---");
               end if;
            end if;
         end if;

         if Do_Coverage_Test then
608
609
            Success :=
              Execute_Coverage_Test (Integer (Timeout)) and then Success;
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
         end if;

         --  Free memory
         Execution_Utils.Reset;
         Execution_Tests.Reset;
         Free (Scenario_Dir);

         --  Exit if one of the tests failed

         if not Success then
            OS_Exit (1);
         end if;
      end if;

      --  Leave the output directory
      Leave_Directory;
   end Generate;

   ----------
   -- Init --
   ----------

   procedure Init is
   begin
      Register_Backend ("polyorb_hi_c", Generate'Access, PolyORB_HI_C);
      Ocarina.Backends.PO_HI_C.Runtime.Initialize;
   end Init;

   -----------
   -- Reset --
   -----------

   procedure Reset is
   begin
      Ocarina.Backends.PO_HI_C.Runtime.Reset;
   end Reset;

647
648
649
650
651
652
653
654
655
   ------------------------------
   -- Use_Performance_Analysis --
   ------------------------------

   function Use_Performance_Analysis return Boolean is
   begin
      return Add_Performance_Analysis;
   end Use_Performance_Analysis;

656
657
658
659
660
661
662
663
664
   -------------------------
   -- Use_ASN1_Deployment --
   -------------------------

   function Use_ASN1_Deployment return Boolean is
   begin
      return Generate_ASN1_Deployment;
   end Use_ASN1_Deployment;

665
666
667
668
669
670
671
672
673
   --------------------------
   --  Set_ASN1_Deployment --
   --------------------------

   procedure Set_ASN1_Deployment (Use_It : Boolean) is
   begin
      Generate_ASN1_Deployment := Use_It;
   end Set_ASN1_Deployment;

674
675
676
677
678
679
680
681
682
   -------------------------------
   --  Set_Performance_Analysis --
   -------------------------------

   procedure Set_Performance_Analysis (Use_It : Boolean) is
   begin
      Add_Performance_Analysis := Use_It;
   end Set_Performance_Analysis;

683
684
685
686
687
688
   ---------------------------------
   -- Visit_Architecture_Instance --
   ---------------------------------

   procedure Visit_Architecture_Instance (E : Node_Id) is
   begin
689
690
      --  Generate header files

691
692
693
694
695
696
697
698
      Naming.Header_File.Visit (E);
      C_Common.Types.Header_File.Visit (E, C_Root);
      Deployment.Header_File.Visit (E);
      Request.Header_File.Visit (E);
      Marshallers.Header_File.Visit (E);
      C_Common.Subprograms.Header_File.Visit (E, C_Root);
      Activity.Header_File.Visit (E);

699
700
      --  Generate source files

701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
      C_Common.Types.Source_File.Visit (E, C_Root);
      Request.Source_File.Visit (E);
      Marshallers.Source_File.Visit (E);
      Deployment.Source_File.Visit (E);
      Activity.Source_File.Visit (E);
      C_Common.Subprograms.Source_File.Visit (E);
      Naming.Source_File.Visit (E);
      Main.Source_File.Visit (E);

      --  Generate a Makefile for each node

      Build_Utils.Makefiles.Visit (E);

   end Visit_Architecture_Instance;

end Ocarina.Backends.PO_HI_C;