ocarina-backends-python-generator.ads 4.11 KB
Newer Older
yoogx's avatar
yoogx committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
------------------------------------------------------------------------------
--                                                                          --
--                           OCARINA COMPONENTS                             --
--                                                                          --
--    O C A R I N A . B A C K E N D S . P Y T H O N . G E N E R A T O R     --
--                                                                          --
--                                 S p e c                                  --
--                                                                          --
--                     Copyright (C) 2016 ESA & ISAE.                       --
--                                                                          --
-- 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/>.                                          --
--                                                                          --
--                 Ocarina is maintained by the TASTE project               --
--                      (taste-users@lists.tuxfamily.org)                   --
--                                                                          --
------------------------------------------------------------------------------

32
33
34
35
pragma Warnings (Off);

with Fifo;

yoogx's avatar
yoogx committed
36
package Ocarina.Backends.Python.Generator is
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

   type Port is record
      name      : Name_Id;
      port_type : Name_Id;
      c_type    : Name_Id;
      direction : Name_Id;
   end record;

   package Port_List is new Fifo (Element_Type => Port);

   type Funct is record
      source : Name_Id;
      name   : Name_Id;
      ports  : Port_List.Fifo_Type;
   end record;

   type Call_Funct is record
      has_before      : Boolean := False;
      has_loop        : Boolean := False;
      has_after       : Boolean := False;
      Before_Function : Funct;
      Loop_Function   : Funct;
      After_Function  : Funct;
   end record;

   type Binding is record
      first_name        : Name_Id;
      instance_name     : Name_Id;
65
      Simulation_Model  : Name_Id;
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
      second_name       : Name_Id;
      component_type    : Name_Id;
      priority          : Name_Id;
      period            : Name_Id;
      scheduling_policy : Name_Id;
      dispatch_protocol : Name_Id;
      function_calls    : Call_Funct;
      ports             : Port_List.Fifo_Type;
   end record;

   package Binding_List is new Fifo (Element_Type => Binding);

   type ss_project is record
      project_name   : Name_Id;
      Module_List    : Binding_List.Fifo_Type;
      Device_List    : Binding_List.Fifo_Type;
      Processor_List : Binding_List.Fifo_Type;
      Bus_List       : Binding_List.Fifo_Type;
      Memory_List    : Binding_List.Fifo_Type;
   end record;

   Var_Name_Len    : Natural := 0;
   project         : ss_project;
   Print_On_Stdout : Boolean := False;

   procedure Generate (N : Node_Id);
   --  All code generation is performed in the current directory. It
   --  is up to the caller to change the working directory before
   --  calling Generate.

yoogx's avatar
yoogx committed
96
end Ocarina.Backends.Python.Generator;