system_demo.aadl 2.83 KB
Newer Older
1
package System_Demo
2 3 4 5 6 7 8

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

9
   with Generic_Bus;
10 11 12 13 14 15 16 17 18 19
   with Generic_Native;   -- Generic hardware
   with TCP_IP_Protocol;  -- TCP/IP protocol stack, as an AADL device
   with Beeper;           -- Beeper device
   with Software;         -- Software part for this demo

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

   system The_Demo
20
   end The_Demo;
21 22

   system implementation The_Demo.impl
23
   subcomponents
24 25 26 27

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

28
     Bus_TCP      : bus Generic_Bus::Generic_Bus.impl;
29

yoogx's avatar
yoogx committed
30 31 32 33
     -- Node #1 software components

     Node_1 : process Software::Pinger_Process.Impl;

34 35 36 37 38 39 40
     ------------------------------------------------------------------
     -- 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
41
      { Deployment::Location    => "ip 127.0.0.1 1233"; };
42
     --     Beeper_1     : device Beeper::Beeper_Device.impl;
43

yoogx's avatar
yoogx committed
44 45
     ------------------------------------------------------------------
     -- Node #2 software components
46

yoogx's avatar
yoogx committed
47
     Node_2 : process Software::Pingee_Process.Impl;
48 49 50 51 52 53

     -- 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
54
      { Deployment::Location    => "ip 127.0.0.1 2345"; };
55 56 57 58 59 60 61 62 63 64 65 66 67


   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
yoogx's avatar
yoogx committed
68
          { Actual_Connection_Binding => (reference (Bus_TCP)); };
69 70 71 72 73 74 75 76

   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;
77
     Actual_Processor_Binding => (reference (Processor_1))
yoogx's avatar
yoogx committed
78
                              applies to TCP_IP_Cnx_1;
79 80

     Actual_Processor_Binding => (reference (Processor_2)) applies to Node_2;
81
     Actual_Processor_Binding => (reference (Processor_2))
yoogx's avatar
yoogx committed
82
                              applies to TCP_IP_Cnx_2;
83 84
   end The_Demo.impl;

85
end System_Demo;