producer_consumer.aadl 1.87 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
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
76
77
78
79
80
81
82
83
84
85
package Producer::Consumer
public
  with Deployment, Software;

---------
-- Bus --
---------

bus Ethernet_Bus
properties
  Deployment::Transport_API => BSD_Sockets;
end Ethernet_Bus;

---------------
-- Processor --
---------------

processor the_processor
features
  ETH : requires bus access Ethernet_Bus;
properties
  Deployment::location           => "127.0.0.1";
  Deployment::Execution_Platform => Native;
end the_processor;

---------------
-- 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;

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

system PC_Simple
end PC_Simple;

system implementation PC_Simple.Impl
subcomponents
  pr_A : process A.Impl {Deployment::port_number => 4001;};
  pr_B : process B.Impl {Deployment::port_number => 4002;};

  CPU     : processor the_processor;
  the_bus : bus Ethernet_Bus;
connections
  bus access the_bus -> CPU.ETH;
  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
  actual_processor_binding => reference (CPU) applies to pr_A;
  actual_processor_binding => reference (CPU) applies to pr_B;
end PC_Simple.Impl;

end Producer::Consumer;