producer_consumer.aadl 7.42 KB
Newer Older
1
2
3
package Producer::Consumer
public
  with Deployment, Software;
4
5
  with ocarina_drivers;
  with ocarina_buses;
yoogx's avatar
yoogx committed
6
  with ocarina_drivers_grspw_packet;
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
64
65
66
67
68
69
70
71
72
73
74
75
  ---------------
  -- Processor --
  ---------------

  processor the_processor
  properties
    Deployment::Execution_Platform => Native;
  end the_processor;

  processor implementation the_processor.i
  end the_processor.i;

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

  process A
  features
    Alpha : out data port Software::Alpha_Type;
    Beta  : in data port Software::Alpha_Type;
  end A;

  process implementation A.Impl
  subcomponents
    Producer        : thread Software::P.Impl;
    Result_Consumer : thread Software::Q.Impl;
  connections
    port Producer.Data_Source -> Alpha;
    port Beta -> Result_Consumer.Data_Sink;
  end A.Impl;

  process B
  features
    Alpha : out data port Software::Alpha_Type;
    Beta  : in data port Software::Alpha_Type;
  end B;

  process implementation B.Impl
  subcomponents
    Consumer        : thread Software::Q.Impl;
    Result_Producer : thread Software::P.Impl;
  connections
    port Beta -> Consumer.Data_Sink;
    port Result_Producer.Data_Source -> Alpha;
  end B.Impl;

  process singleProcess
  end singleProcess;

  process implementation singleProcess.Impl
  subcomponents
    ProducerA        : thread Software::P.Impl;
    Result_ConsumerA : thread Software::Q.Impl;
    ConsumerB        : thread Software::Q.Impl;
    Result_ProducerB : thread Software::P.Impl;
  connections
    port ProducerA.Data_Source -> ConsumerB.Data_Sink;
    port Result_ProducerB.Data_Source -> Result_ConsumerA.Data_Sink;
  end singleProcess.Impl;

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

  system PC_Simple
  end PC_Simple;

  system implementation PC_Simple.Impl
76
77
    --  Producer/Consummer using TCP/IP sockets

78
  subcomponents
79
80
    pr_A : process A.Impl;
    pr_B : process B.Impl;
81
82
83
84
85
86
87
88
89
90
91
92
    Device_A : device ocarina_drivers::generic_sockets_ip.pohic
    {Source_Text => ("devicesconf.c");};
    Device_B : device ocarina_drivers::generic_sockets_ip.pohic
    {Source_Text => ("devicesconf.c");};
    CPU_A : processor the_processor.i;
    CPU_B : processor the_processor.i;
    the_bus : bus ocarina_buses::ip.i;
  connections
    bus access the_bus -> Device_A.link;
    bus access the_bus -> Device_B.link;

    port pr_A.Alpha -> pr_B.Beta
93
    {Actual_Connection_Binding => (reference (the_bus));};
94
    port pr_B.Alpha -> pr_A.Beta
95
    {Actual_Connection_Binding => (reference (the_bus));};
96
  properties
yoogx's avatar
yoogx committed
97
98
    actual_processor_binding => (reference (CPU_A)) applies to pr_A;
    actual_processor_binding => (reference (CPU_B)) applies to pr_B;
99
100
101
102
    actual_processor_binding => (reference (CPU_A)) applies to Device_A;
    actual_processor_binding => (reference (CPU_B)) applies to Device_B;
  end PC_Simple.Impl;

103
104
105
106
107
108
109
  system implementation PC_Simple.Impl_Spw
    --  Producer/Consummer, refined to LEON/RTEMS POSIX with SpaceWire
    --  communications using rasta_spacewire.pohic driver, based on
    --  GRSPW IOCTL driver.

    --  XXXX check why we cannot extend the previous impl

110
  subcomponents
111
112
113
114
115
116
    pr_A : process A.Impl;
    Device_A : device ocarina_drivers::rasta_spacewire.pohic
    {Source_Text => ("devicesconf_spw.c");};
    pr_B : process B.Impl;
    Device_B :  device ocarina_drivers::rasta_spacewire.pohic
    {Source_Text => ("devicesconf_spw.c");};
117
    CPU_A : processor the_processor.i;
118
119
120
    CPU_B : processor the_processor.i;
    the_bus : bus ocarina_buses::spacewire.generic;

121
122
  connections
    bus access the_bus -> Device_A.link;
123
    bus access the_bus -> Device_B.link;
124

125
126
127
    port pr_A.Alpha -> pr_B.Beta
    {Actual_Connection_Binding => (reference (the_bus));};
    port pr_B.Alpha -> pr_A.Beta
128
    {Actual_Connection_Binding => (reference (the_bus));};
129

130
  properties
131
132
    Deployment::Execution_Platform => LEON_RTEMS_POSIX applies to CPU_A;
    Deployment::Execution_Platform => LEON_RTEMS_POSIX applies to CPU_B;
yoogx's avatar
yoogx committed
133
    actual_processor_binding => (reference (CPU_A)) applies to pr_A;
134
    actual_processor_binding => (reference (CPU_B)) applies to pr_B;
135
    actual_processor_binding => (reference (CPU_A)) applies to Device_A;
136
137
138
139
140
141
142
    actual_processor_binding => (reference (CPU_B)) applies to Device_B;
  end PC_Simple.Impl_Spw;

  system implementation PC_Simple.Impl_Spw2
    --  Producer/Consummer, refined to LEON/RTEMS POSIX with SpaceWire
    --  communications using rasta_spacewire.pohic driver, based on
    --  GRSPW IOCTL driver.
143

yoogx's avatar
yoogx committed
144
  subcomponents
145
    pr_A : process A.Impl;
yoogx's avatar
yoogx committed
146
    Device_A : device ocarina_drivers::rasta_spacewire.grspw_pohic
147
148
149
150
    {Source_Text => ("devicesconf_spw.c");};
    pr_B : process B.Impl;
    Device_B :  device ocarina_drivers::rasta_spacewire.grspw_pohic
    {Source_Text => ("devicesconf_spw.c");};
yoogx's avatar
yoogx committed
151
    CPU_A : processor the_processor.i;
152
    CPU_B : processor the_processor.i;
yoogx's avatar
yoogx committed
153
    the_bus : bus ocarina_buses::spacewire.generic;
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182

  connections
    bus access the_bus -> Device_A.link;
    bus access the_bus -> Device_B.link;

    port pr_A.Alpha -> pr_B.Beta
    {Actual_Connection_Binding => (reference (the_bus));};
    port pr_B.Alpha -> pr_A.Beta
    {Actual_Connection_Binding => (reference (the_bus));};

  properties
    Deployment::Execution_Platform => LEON_RTEMS_POSIX applies to CPU_A;
    Deployment::Execution_Platform => LEON_RTEMS_POSIX applies to CPU_B;
    actual_processor_binding => (reference (CPU_A)) applies to pr_A;
    actual_processor_binding => (reference (CPU_B)) applies to pr_B;
    actual_processor_binding => (reference (CPU_A)) applies to Device_A;
    actual_processor_binding => (reference (CPU_B)) applies to Device_B;

  end PC_Simple.Impl_Spw2;

  system implementation PC_Simple.Loopback
    -- Variant of Producer/Consummer using TCP/IP sockets in loopback mode

  subcomponents
    pr_A : process A.Impl {Deployment::port_number => 4001;};
    Device_A : device ocarina_drivers::generic_sockets_ip.pohic
    {Source_Text => ("devicesconf.c");};
    CPU_A : processor the_processor.i;
    the_bus : bus ocarina_buses::ip.i;
yoogx's avatar
yoogx committed
183
184
185
186
187
188
189
190
  connections
    bus access the_bus -> Device_A.link;

    port pr_A.Alpha -> pr_A.Beta
    {Actual_Connection_Binding => (reference (the_bus));};
  properties
    actual_processor_binding => (reference (CPU_A)) applies to pr_A;
    actual_processor_binding => (reference (CPU_A)) applies to Device_A;
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
  end PC_Simple.Loopback;

  system implementation PC_Simple.Loopback_Spw extends PC_Simple.Loopback
    --  Loopback variant using SpaceWire
    --
    --  Note; does not work properly, as we cannot perform loopback
    --  with rasta_spacewire.pohic driver. Used only to test proper
    --  sending.
  subcomponents
    Device_A : refined to device ocarina_drivers::rasta_spacewire.pohic
    {Source_Text => ("devicesconf_spw.c");};
    the_bus : refined to bus ocarina_buses::spacewire.generic;

  properties
    Deployment::Execution_Platform => LEON_RTEMS_POSIX applies to CPU_A;
yoogx's avatar
yoogx committed
206
207
  end PC_Simple.Loopback_Spw;

208
209
210
211
212
  system implementation PC_Simple.local
  subcomponents
    prodr_cons : process singleProcess.Impl;
    CPU_A : processor the_processor.i;
  properties
yoogx's avatar
yoogx committed
213
    actual_processor_binding => (reference (CPU_A)) applies to prodr_cons;
214
215
216
217
218
219
220
221
222
223
224
  end PC_Simple.local;

  system implementation PC_Simple.Xenomai
  extends PC_Simple.local
  properties
    Deployment::Execution_Platform => linux32_xenomai_native applies to CPU_A;
  end PC_Simple.Xenomai;

  system implementation PC_Simple.RTEMS
  extends PC_Simple.local
  properties
225
    Deployment::Execution_platform => LEON_RTEMS_POSIX applies to CPU_A ;
226
  end PC_Simple.RTEMS;
227
228

end Producer::Consumer;