Commit d6f67bcc authored by hugues.jerome's avatar hugues.jerome
Browse files

* Add PolyORB-HI/Ada variant of drivers



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@1526 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent bdb2af0a
This diff is collapsed.
package Generic_Bus
public
---------
-- BUS --
---------
-- Generic bus to model connections between processors and
-- devices. It is not used by the code generation process, so it is
-- made fully generic.
bus Generic_Bus
end Generic_Bus;
bus implementation Generic_Bus.impl
end Generic_Bus.impl;
end Generic_Bus;
package GRSPW
-- This package models a SpaceWire-based protocol layer for the
-- PolyORB-HI/Ada AADL runtime, based on the GRSPW chipset from
-- AEROFlex Gaisler. It defines the subprograms and threads to be
-- integrated with the runtime low level interface.
--
-- To configure this interface, you should use the
-- Deployment::Configuration property with the following format:
-- "spacewire Sender_Core_id Receiver_Core_Id"
--
-- e.g.
--
-- spw : device GRSPW::GRSPW_Device
-- {Deployment::Configuration => "spacewire 1 2"};
--
public
with GR_CPCI_X4CV;
with Generic_Bus;
------------
-- DEVICE --
------------
-- The main entrypoint for this package is this device, it relies
-- on the 'Implement_As' feature that defines its full
-- specification.
device GRSPW_Device
features
LVDS_Wire : requires bus access Generic_Bus::Generic_Bus.impl;
-- Connection to the remote node
end GRSPW_Device;
device implementation GRSPW_Device.impl
properties
Implemented_As =>
classifier (GRSPW::Driver_GRSPW_Protocol.impl);
Initialize_Entrypoint => classifier (GRSPW::Initialize);
end GRSPW_Device.impl;
------------
-- DRIVER --
------------
-- In AADLv2, we can model the actual implementation of a driver
-- using an abstract component.
abstract Driver_GRSPW_Protocol
end Driver_GRSPW_Protocol;
abstract implementation Driver_GRSPW_Protocol.impl
subcomponents
receiver : thread Driver_GRSPW_Protocol_thread_receiver.impl;
end Driver_GRSPW_Protocol.impl;
-------------
-- THREADS --
-------------
-- This thread handles the execution logic of the protocol
-- stack. It relies on the previous subprograms to receive
-- messages.
thread Driver_GRSPW_Protocol_thread_receiver
-- This thread is dispatched when an event is detected on the
-- real hardware. It then calls receive to handle the incoming
-- event.
properties
Dispatch_Protocol => Background;
Priority => 12;
end Driver_GRSPW_Protocol_thread_receiver;
thread implementation Driver_GRSPW_Protocol_thread_receiver.impl
calls
call1 : { pspg : subprogram receive; };
end Driver_GRSPW_Protocol_thread_receiver.impl;
-----------------
-- SUBPROGRAMS --
-----------------
-- These subprograms model the high-level view of the SpaceWire
-- protocol stack. They define an API used by the stack to send and
-- receive data, and perform node's initialisation.
subprogram Initialize
-- Initialize the different internal resources for managing
-- connections on a node. This subprogram has no formal visible
-- parameters, but relies on well-known data structures and
-- variables to configure the stack.
properties
Source_Name => "PolyORB_HI_Drivers_GRSPW.Initialize";
Source_Language => Ada;
end Initialize;
-------------
subprogram Receive
-- Receive data and dispatch them to the receiving entity. This
-- program and its sibling (send) share a common protocol, not
-- defined in the AADL model.
properties
Source_Name => "PolyORB_HI_Drivers_GRSPW.Receive";
Source_Language => Ada;
end Receive;
-------------
subprogram Send
-- Send data to a remote node. This program and its sibling
-- (receive) share a common protocol, not defined in the AADL
-- model.
properties
Source_Name => "PolyORB_HI_Drivers_GRSPW.Send";
Source_Language => Ada;
end Send;
end GRSPW;
package GRUART
-- This package models a UART-based protocol layer for the
-- PolyORB-HI/Ada AADL runtime, based on the GRUART chipset from
-- AEROFlex Gaisler. It defines the subprograms and threads to be
-- integrated with the runtime low level interface.
--
-- To configure this interface, you should use the
-- Deployment::Configuration property with the following format:
-- "serial DEVICE BAUDS DATA_BITS PARITY STOP_BIT"
--
-- e.g.
--
-- uart : device GRUART::GRUART_Device
-- {Deployment::Configuration => "serial /dev/ttyS0 9600 8 N 1"
--
public
with Generic_Bus;
------------
-- DEVICE --
------------
-- The main entrypoint for this package is this device, it relies
-- on the 'Implement_As' feature that defines its full
-- specification.
device GRUART_Device
features
DB9_Wire : requires bus access Generic_Bus::Generic_Bus.impl;
-- Connection to the remote node
end GRUART_Device;
device implementation GRUART_Device.impl
properties
Implemented_As =>
classifier (GRUART::Driver_GRUART_Protocol.impl);
Initialize_Entrypoint => classifier (GRUART::Initialize);
end GRUART_Device.impl;
------------
-- DRIVER --
------------
-- In AADLv2, we can model the actual implementation of a driver
-- using an abstract component.
abstract Driver_GRUART_Protocol
end Driver_GRUART_Protocol;
abstract implementation Driver_GRUART_Protocol.impl
subcomponents
receiver : thread Driver_GRUART_Protocol_thread_receiver.impl;
end Driver_GRUART_Protocol.impl;
-------------
-- THREADS --
-------------
-- This thread handles the execution logic of the protocol
-- stack. It relies on the previous subprograms to receive
-- messages.
thread Driver_GRUART_Protocol_thread_receiver
-- This thread is dispatched when an event is detected on the
-- real hardware. It then calls receive to handle the incoming
-- event.
properties
Dispatch_Protocol => Background;
Priority => 10;
source_stack_size => 200 KByte;
end Driver_GRUART_Protocol_thread_receiver;
thread implementation Driver_GRUART_Protocol_thread_receiver.impl
calls
call1 : { pspg : subprogram receive; };
end Driver_GRUART_Protocol_thread_receiver.impl;
-----------------
-- SUBPROGRAMS --
-----------------
-- These subprograms model the high-level view of the SpaceWire
-- protocol stack. They define an API used by the stack to send and
-- receive data, and perform node's initialisation.
subprogram Initialize
-- Initialize the different internal resources for managing
-- connections on a node. This subprogram has no formal visible
-- parameters, but relies on well-known data structures and
-- variables to configure the stack.
properties
Source_Name => "PolyORB_HI_Drivers_GRUART.Initialize";
Source_Language => Ada;
end Initialize;
-------------
subprogram Receive
-- Receive data and dispatch them to the receiving entity. This
-- program and its sibling (send) share a common protocol, not
-- defined in the AADL model.
properties
Source_Name => "PolyORB_HI_Drivers_GRUART.Receive";
Source_Language => Ada;
end Receive;
-------------
subprogram Send
-- Send data to a remote node. This program and its sibling
-- (receive) share a common protocol, not defined in the AADL
-- model.
properties
Source_Name => "PolyORB_HI_Drivers_GRUART.Send";
Source_Language => Ada;
end Send;
end GRUART;
package Native_UART
-- This package models a UART protocol layer for the PolyORB-HI/Ada
-- AADL runtime. It defines the subprograms and threads to be
-- integrated with the runtime low level interface.
--
-- To configure this interface, you should use the
-- Deployment::Configuration property with the following format:
-- "serial DEVICE BAUDS DATA_BITS PARITY STOP_BIT"
--
-- e.g.
--
-- uart : device GRUART::GRUART_Device
-- {Deployment::Configuration => "serial /dev/ttyS0 9600 8 N 1"
--
public
with Generic_Bus;
------------
-- DEVICE --
------------
-- The main entrypoint for this package is this device, it relies
-- on the 'Implement_As' feature that defines its full
-- specification.
device Native_UART_Device
features
DB9_Wire : requires bus access Generic_Bus::Generic_Bus.impl;
-- Connection to the remote node
end Native_UART_Device;
device implementation Native_UART_Device.impl
properties
Implemented_As =>
classifier (Native_UART::Driver_Native_UART_Protocol.impl);
Initialize_Entrypoint => classifier (Native_UART::Initialize);
end Native_UART_Device.impl;
------------
-- DRIVER --
------------
-- In AADLv2, we can model the actual implementation of a driver
-- using an abstract component.
abstract Driver_Native_UART_Protocol
end Driver_Native_UART_Protocol;
abstract implementation Driver_Native_UART_Protocol.impl
subcomponents
receiver : thread Driver_Native_UART_Protocol_thread_receiver.impl;
end Driver_Native_UART_Protocol.impl;
-------------
-- THREADS --
-------------
-- This thread handles the execution logic of the protocol
-- stack. It relies on the previous subprograms to receive
-- messages.
thread Driver_Native_UART_Protocol_thread_receiver
-- This thread is dispatched when an event is detected on the
-- real hardware. It then calls receive to handle the incoming
-- event.
properties
Dispatch_Protocol => Background;
Priority => 10;
source_stack_size => 200 KByte;
end Driver_Native_UART_Protocol_thread_receiver;
thread implementation Driver_Native_UART_Protocol_thread_receiver.impl
calls
call1 : { pspg : subprogram receive; };
end Driver_Native_UART_Protocol_thread_receiver.impl;
-----------------
-- SUBPROGRAMS --
-----------------
-- These subprograms model the high-level view of the SpaceWire
-- protocol stack. They define an API used by the stack to send and
-- receive data, and perform node's initialisation.
subprogram Initialize
-- Initialize the different internal resources for managing
-- connections on a node. This subprogram has no formal visible
-- parameters, but relies on well-known data structures and
-- variables to configure the stack.
properties
Source_Name => "PolyORB_HI_Drivers_Native_UART.Initialize";
Source_Language => Ada;
end Initialize;
-------------
subprogram Receive
-- Receive data and dispatch them to the receiving entity. This
-- program and its sibling (send) share a common protocol, not
-- defined in the AADL model.
properties
Source_Name => "PolyORB_HI_Drivers_Native_UART.Receive";
Source_Language => Ada;
end Receive;
-------------
subprogram Send
-- Send data to a remote node. This program and its sibling
-- (receive) share a common protocol, not defined in the AADL
-- model.
properties
Source_Name => "PolyORB_HI_Drivers_Native_UART.Send";
Source_Language => Ada;
end Send;
end Native_UART;
package TCP_IP_Protocol
-- This package models a TCP/IP based protocol layer for the
-- PolyORB-HI/Ada AADL runtime. It defines the subprograms and threads
-- to be integrated with the runtime low level interface.
--
-- To configure this interface, you should use the
-- Deployment::Configuration property with the following format:
-- "ip <ipv4_addresse> <ipv4_port>"
--
-- e.g.
--
-- netif : device TCP_IP_Protocol::TCP_IP_Device
-- {Deployment::Configuration => "ip 192.168.0.10 45678";}:
public
with Generic_Native;
------------
-- DEVICE --
------------
-- The main entrypoint for this package is this device, it relies
-- on the 'Implement_As' feature that defines its full
-- specification.
device TCP_IP_Device
features
Ethernet_Wire : requires bus access Generic_Native::Generic_Bus.impl;
-- Connection to the remote node
end TCP_IP_Device;
device implementation TCP_IP_Device.impl
properties
Implemented_As =>
classifier (TCP_IP_Protocol::Driver_TCP_IP_Protocol.impl);
Initialize_Entrypoint => classifier (TCP_IP_Protocol::Initialize);
end TCP_IP_Device.impl;
------------
-- DRIVER --
------------
-- In AADLv2, we can model the actual implementation of a driver
-- using an abstract component.
abstract Driver_TCP_IP_Protocol
end Driver_TCP_IP_Protocol;
abstract implementation Driver_TCP_IP_Protocol.impl
subcomponents
receiver : thread Driver_TCP_IP_Protocol_thread_receiver.impl;
end Driver_TCP_IP_Protocol.impl;
-------------
-- THREADS --
-------------
-- This thread handles the execution logic of the protocol
-- stack. It relies on the previous subprograms to receive
-- messages.
thread Driver_TCP_IP_Protocol_thread_receiver
-- This thread is dispatched when an event is detected on the
-- real hardware. It then calls receive to handle the incoming
-- event.
properties
-- Initialize_Entrypoint
-- => classifier (TCP_IP_Protocol::Initialize_Receiver);
Dispatch_Protocol => Background;
end Driver_TCP_IP_Protocol_thread_receiver;
thread implementation Driver_TCP_IP_Protocol_thread_receiver.impl
calls
call1 : { pspg : subprogram receive; };
end Driver_TCP_IP_Protocol_thread_receiver.impl;
-----------------
-- SUBPROGRAMS --
-----------------
-- These subprograms model the high-level view of the TCP/IP
-- protocol stack. They define an API used by the stack to send and
-- receive data, and perform node's initialisation.
subprogram Initialize
-- Initialize the different internal resources for managing
-- connections on a node. This subprogram has no formal visible
-- parameters, but relies on well-known data structures and
-- variables to configure the stack.
properties
Source_Name => "POlyORB_HI_Drivers_Native_TCP_IP.Initialize";
Source_Language => Ada;
end Initialize;
-------------
subprogram Initialize_Receiver
-- Initialize the receiver thread
properties
Source_Name => "POlyORB_HI_Drivers_Native_TCP_IP.Initialize_Receiver";
Source_Language => Ada;
end Initialize_Receiver;
-------------
subprogram Receive
-- Receive data and dispatch them to the receiving entity. This
-- program and its sibling (send) share a common protocol, not
-- defined in the AADL model.
properties
Source_Name => "POlyORB_HI_Drivers_Native_TCP_IP.Receive";
Source_Language => Ada;
end Receive;
-------------
subprogram Send
-- Send data to a remote node. This program and its sibling
-- (receive) share a common protocol, not defined in the AADL
-- model.
properties
Source_Name => "POlyORB_HI_Drivers_Native_TCP_IP.Send";
Source_Language => Ada;
end Send;
end TCP_IP_Protocol;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment