system_demo.aadl 3.97 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package System_Demo 

-- This system combines generic native hardware, TCP/IP protocol stack
-- and some software to build a full ping demo.

public
   with Deployment;       -- Additional properties (provided by Ocarina)

   with Generic_Native;   -- Generic hardware
   with TCP_IP_Protocol;  -- TCP/IP protocol stack, as an AADL device
   with UART_Line;        -- UART device, as an AADL device
   with Beeper;           -- Beeper device
   with Software;         -- Software part for this demo

   ------------
   -- SYSTEM --
   ------------

   system The_Demo
   end The_Demo;	

   system implementation The_Demo.impl
   subcomponents		 

     -- Interconnect bus. This component is shared by Node_1 and
     -- Node_2 to support communication through TCP/IP protocol stack

     Bus_TCP      : bus Generic_Native::Generic_Bus.impl;

     -- DB9 serial line, it is shared by Node_1 and Node_2 to support
     -- communication through the serial line.

     Bus_DB9      : bus Generic_Native::Generic_Bus.impl;

     ------------------------------------------------------------------
     -- Node #1 hardware components

     Processor_1  : processor Generic_Native::Generic_Processor.impl;

     Memory_1     : memory Generic_Native::Memory_Segment.impl;
     TCP_IP_Cnx_1 : device TCP_IP_Protocol::TCP_IP_Device.impl
     		    { Deployment::Location    => "127.0.0.1";
		      Deployment::Port_Number => 1234; };
     UART_Cnx_1 : device UART_Line::UART_Device.impl
     		    { Deployment::Location    => "127.0.0.1";
		      Deployment::Port_Number => 12341; };

--     		    { Deployment::Location    => "/dev/ttyS0";
--		      Deployment::Port_Number => 0; };
--     Beeper_1     : device Beeper::Beeper_Device.impl;

     -- Node #1 software components

     Node_1 : process Software::Pinger_Process.Impl;

     ------------------------------------------------------------------
     -- Node #2 hardware components

     Processor_2  : processor Generic_Native::Generic_Processor.impl;
     Memory_2     : memory Generic_Native::Memory_Segment.impl;
     TCP_IP_Cnx_2 : device TCP_IP_Protocol::TCP_IP_Device.impl
     		    { Deployment::Location    => "127.0.0.1";
		      Deployment::Port_Number => 2345; };
     UART_Cnx_2 : device UART_Line::UART_Device.impl
     		    { Deployment::Location    => "127.0.0.1";
		      Deployment::Port_Number => 23451; };
--     		    { Deployment::Location    => "/dev/ttyS1";
--		      Deployment::Port_Number => 0; };

     -- Node #2 software components

     Node_2 : process Software::Pingee_Process.Impl;

   connections

     -- By connecting the bus to the driver, and binding the
     -- connection between Node_1.Out_Port and Node_2.In_Port to the
     -- bus, we model the fact that the communication between port
     -- 'Out_Port' of Node_1 and 'In_Port' of Node_2 will use the TCP
     -- protocol stack.

     bus access Bus_TCP -> TCP_IP_Cnx_1.Ethernet_Wire;
     bus access Bus_TCP -> TCP_IP_Cnx_2.Ethernet_Wire;
     port Node_1.Out_Port -> Node_2.In_Port
     	  { Actual_Connection_Binding => (reference (Bus_TCP)); };

     bus access Bus_DB9 -> UART_Cnx_1.Serial_Wire;
     bus access Bus_DB9 -> UART_Cnx_2.Serial_Wire;
     port Node_1.Out_Port_2 -> Node_2.In_Port_2
     	  { Actual_Connection_Binding => (reference (Bus_DB9)); };

   properties

     -- By binding the device to the processor, we specify that the
     -- processor (and then any bound process) have access to this
     -- driver.

     Actual_Processor_Binding => (reference (Processor_1)) applies to Node_1;
     Actual_Processor_Binding => (reference (Processor_1)) 
     			      applies to TCP_IP_Cnx_1;
     Actual_Processor_Binding => (reference (Processor_1)) 
     			      applies to UART_Cnx_1;

     Actual_Processor_Binding => (reference (Processor_2)) applies to Node_2;
     Actual_Processor_Binding => (reference (Processor_2)) 
     			      applies to TCP_IP_Cnx_2;
     Actual_Processor_Binding => (reference (Processor_2)) 
     			      applies to UART_Cnx_2;
   end The_Demo.impl;

end System_Demo;