robot.aadl 4.52 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
32
33
34
35
36
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
package Robot
public
  with Deployment;
  with Data_Model;

  ----------
  -- Data --
  ----------

  data Alpha_Type
  properties
    Data_Model::Data_Representation => integer;
  end Alpha_Type;

  -------------------
  --  Subprograms  --
  -------------------

  subprogram collecte_donnee
  features
    d_source : out parameter Alpha_Type;
  end collecte_donnee;

  subprogram traite
  features
    d_info  : in parameter Alpha_Type;
    d_ordre : out parameter Alpha_Type;
  end traite;

  subprogram action
  features
    d_action : in parameter Alpha_Type;
  end action;

  ---------------
  --  Threads  --
  ---------------

  --  interfaces

  thread capteur
  features
    evenement    : out event data port Alpha_Type;
  end capteur;

  thread controle
  features
    info_capteur : in event data port Alpha_Type;
    comm_servo   : out event data port Alpha_Type;
  end controle;

  thread servomoteur
  features
    ordre        : in event data port Alpha_Type;
  end servomoteur;

  --  implementations

  thread implementation capteur.i
  calls C: {
    D_Spg : subprogram collecte_donnee;
    };
  connections
Ethan McGee's avatar
Ethan McGee committed
64
    conn1: parameter D_Spg.d_source -> evenement;
yoogx's avatar
yoogx committed
65
66
67
68
69
70
71
72
73
74
  properties
    Dispatch_Protocol => Periodic;
    Period            => 110 ms;
  end capteur.i;

  thread implementation controle.i
  calls C: {
    T_Spg : subprogram traite;
    };
  connections
Ethan McGee's avatar
Ethan McGee committed
75
76
    conn1: parameter info_capteur  -> T_Spg.d_info;
    conn2: parameter T_Spg.d_ordre -> comm_servo;
yoogx's avatar
yoogx committed
77
78
79
80
81
82
83
84
85
86
87
  properties
    Dispatch_Protocol => Sporadic;
    Period            => 110 ms;
    Deployment::Priority          => 2;
  end controle.i;

  thread implementation servomoteur.i
  calls main : {
    A_Spg : subprogram action;
    };
  connections
Ethan McGee's avatar
Ethan McGee committed
88
    conn1: parameter ordre -> A_Spg.d_action;
yoogx's avatar
yoogx committed
89
90
91
92
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
  properties
    Dispatch_Protocol => Aperiodic;
    Deployment::Priority          => 1;
  end servomoteur.i;

  -----------------
  --  Processes  --
  -----------------

  --  interfaces

  process p_capteur
  features
    evenement           : out event data port Alpha_Type;
  end p_capteur;

  process p_controle
  features
    info_capteur_droit  : in event data port Alpha_Type;
    comm_servo_droit    : out event data port Alpha_Type;

    info_capteur_gauche : in event data port Alpha_Type;
    comm_servo_gauche   : out event data port Alpha_Type;
  end p_controle;

  process p_servomoteur
  features
    ordre               : in event data port Alpha_Type;
  end p_servomoteur;

  --  implementations

  process implementation p_capteur.i
  subcomponents
    th_c : thread capteur.i;
  connections
Ethan McGee's avatar
Ethan McGee committed
125
    conn1: port th_c.evenement            -> evenement;
yoogx's avatar
yoogx committed
126
127
128
129
130
131
132
  end p_capteur.i;

  process implementation p_controle.i
  subcomponents
    th_ctrl_droit  : thread controle.i;
    th_ctrl_gauche : thread controle.i;
  connections
Ethan McGee's avatar
Ethan McGee committed
133
134
135
136
    conn1: port info_capteur_droit        -> th_ctrl_droit.info_capteur;
    conn2: port th_ctrl_droit.comm_servo  -> comm_servo_droit;
    conn3: port info_capteur_gauche       -> th_ctrl_gauche.info_capteur;
    conn4: port th_ctrl_gauche.comm_servo -> comm_servo_gauche;
yoogx's avatar
yoogx committed
137
138
139
140
141
142
  end p_controle.i;

  process implementation p_servomoteur.i
  subcomponents
    th_servomoteur : thread servomoteur.i;
  connections
Ethan McGee's avatar
Ethan McGee committed
143
    conn1: port ordre -> th_servomoteur.ordre;
yoogx's avatar
yoogx committed
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
170
171
  end p_servomoteur.i;

  --------------
  --  System  --
  --------------

  processor the_processor
  end the_processor;

  --  interface

  system robot
  end robot;

  --  implementation

  system implementation robot.i
  subcomponents
    proc_capteur_droit      : process p_capteur.i;
    proc_capteur_gauche     : process p_capteur.i;

    proc_controle           : process p_controle.i;

    proc_servomoteur_droit  : process p_servomoteur.i;
    proc_servomoteur_gauche : process p_servomoteur.i;

    CPU1                    : processor the_processor;
  connections
Ethan McGee's avatar
Ethan McGee committed
172
173
    conn1: port proc_capteur_droit.evenement    -> proc_controle.info_capteur_droit;
    conn2: port proc_capteur_gauche.evenement   -> proc_controle.info_capteur_gauche;
yoogx's avatar
yoogx committed
174

Ethan McGee's avatar
Ethan McGee committed
175
176
    conn3: port proc_controle.comm_servo_droit  -> proc_servomoteur_droit.ordre;
    conn4: port proc_controle.comm_servo_gauche -> proc_servomoteur_gauche.ordre;
yoogx's avatar
yoogx committed
177
  properties
Ethan McGee's avatar
Ethan McGee committed
178
179
    actual_processor_binding => (reference (CPU1)) applies to proc_capteur_droit;
    actual_processor_binding => (reference (CPU1)) applies to proc_capteur_gauche;
yoogx's avatar
yoogx committed
180

Ethan McGee's avatar
Ethan McGee committed
181
    actual_processor_binding => (reference (CPU1)) applies to proc_controle;
yoogx's avatar
yoogx committed
182

Ethan McGee's avatar
Ethan McGee committed
183
184
    actual_processor_binding => (reference (CPU1)) applies to proc_servomoteur_droit;
    actual_processor_binding => (reference (CPU1)) applies to proc_servomoteur_gauche;
yoogx's avatar
yoogx committed
185
186
187
  end robot.i;

end Robot;