Commit 373703de authored by julien.delange's avatar julien.delange
Browse files

update of the documentation, continued



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@633 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 11b2922d
......@@ -22,10 +22,11 @@ DOC_CODE = $(srcdir)/activity.c $(srcdir)/deployment.h \
$(srcdir)/node_b_activity.c $(srcdir)/marshallers.c \
$(srcdir)/subprograms.c
AADL_MODELS = $(srcdir)/complex_types.aadl $(srcdir)/do_ping_spg.aadl \
$(srcdir)/hardware.aadl $(srcdir)/node_a_model.aadl \
$(srcdir)/ping.aadl $(srcdir)/port_cnx.aadl \
$(srcdir)/processor_binding.aadl \
AADL_MODELS = $(srcdir)/complex_types.aadl $(srcdir)/do_ping_spg.aadl \
$(srcdir)/hardware.aadl $(srcdir)/node_a_model.aadl \
$(srcdir)/ping.aadl $(srcdir)/port_cnx.aadl \
$(srcdir)/processor_binding.aadl \
$(srcdir)/devices.aadl \
$(srcdir)/protected_object_types.aadl \
$(srcdir)/simple_types.aadl $(srcdir)/thread_a.aadl \
$(srcdir)/thread_a_full.aadl $(srcdir)/scenario_sample.aadl
......
package devices
device serial_port_raw
features
serial_line : requires bus access buses::serial.i;
properties
Provided_Virtual_Bus_Class => (classifier (protocols::dummy.i));
end serial_port_raw;
device implementation serial_port_raw.linux
properties
Deployment::Driver_Name => "serial_linux";
Device_Driver => classifier (devices::serial_driver.linux);
Initialize_Entrypoint => classifier (devices::spg_serial_init_linux);
end serial_port_raw.linux;
subprogram spg_serial_poller_linux
properties
Source_Language => C;
Source_Name => "__po_hi_c_driver_serial_linux_poller";
end spg_serial_poller_linux;
subprogram spg_serial_sender_linux
properties
Source_Language => C;
Source_Name => "__po_hi_c_driver_serial_linux_sender";
end spg_serial_sender_linux;
subprogram spg_serial_init_linux
features
data_source : out parameter types::int.i;
properties
Source_Language => C;
Source_Name => "__po_hi_c_driver_serial_linux_init";
end spg_serial_init_linux;
thread serial_poller
end serial_poller;
thread implementation serial_poller.linux
calls
mycall : {
pspg : subprogram spg_serial_poller_linux;
};
properties
Period => 1000ms;
Dispatch_Protocol => Periodic;
end serial_poller.linux;
thread implementation serial_poller.rasta
calls
mycall : {
pspg : subprogram spg_serial_poller_rasta;
};
properties
Period => 1000ms;
Dispatch_Protocol => Periodic;
end serial_poller.rasta;
abstract serial_driver
end serial_driver;
abstract implementation serial_driver.linux
subcomponents
receiver : thread serial_poller.linux;
sender : subprogram spg_serial_sender_linux;
end serial_driver.linux;
abstract implementation serial_driver.rasta
subcomponents
receiver : thread serial_poller.rasta;
sender : subprogram spg_serial_sender_rasta;
end serial_driver.rasta;
end devices;
......@@ -892,8 +892,7 @@ For more detail on the mapping of subprogram components, see
The deployment information is the information each node has on the
other nodes in the distributed applications. This information is used,
in conjunction with the naming table (see the next paragraph) to allow
a node to send a request to another node or to receive a request from
to send a request to another node or to receive a request from
another node. The deployment information is generated for each node in
two C files : @file{deployment.h} and @file{deployment.c}.
......@@ -931,9 +930,11 @@ More, this file contains the following maccros :
use on the current node.
@item @code{__PO_HI_NB_PORTS} that represent the total number of ports
in the whole distributed system.
@item @code{__PO_HI_NB_DEVICES} that represent the total number of devices
in the whole distributed system.
@end itemize
The file @file{deployment.c} contains three variables :
The file @file{deployment.c} contains the following variables :
@itemize @bullet
@item @code{mynode} variable which has the value of the
handled node.
......@@ -947,47 +948,30 @@ The file @file{deployment.c} contains three variables :
@item @code{__po_hi_port_global_to_entity} variable is used
to know on which entity a given port is. This table is used
convert a global port identifier to an entity identifier.
@end itemize
The following example shows the @code{Deployment} package relative to
the node @code{A} of the @code{Ping} example:
@item @code{__po_hi_uint8_t __po_hi_deployment_endiannesses}
variable details which the endianess of each node. It is an array
which size is @code{__PO_HI_NB_NODES}.
@include deployment.h.texi
@item @code{__po_hi_port_to_device} is an array which size is @code{__PO_HI_NB_PORTS}.
For each port, it indicates the value of the device identifier that handles
it.
@subsubsection Naming information
@item @code{__po_hi_port_global_model_names} is an array which size is
@code{__PO_HI_NB_PORTS}. For each port, it contains the name of the port.
The naming information for a particular node @code{A} allow this node
to send requests to another node in the distributed application and to
receive a request from another node. It contains for each node, the
information necessary to establish a connection with a remote
node. These information are deduced statically from the AADL model.
@item @code{__po_hi_port_global_names} is an array which size is @code{__PO_HI_NB_PORTS}.
For each port, it contains the name generated by the code generator.
The naming information is generated in a file called @file{naming.c}.
@include naming.c.texi
As shown in the example above, for the node @code{A} of the
@code{Ping} example, the @file{naming.c} file contains:
@itemize @bullet
@item An array called @code{node_port} indexed by the values
of @code{__po_hi_node_t}. It tells the port to connect
on for each node in the distributed system.
@item An array called @code{node_addr} indexes by the values
of @code{__po_hi_node_t}. It tells the address to connect
on for each node.
@item @code{__po_hi_devices_naming} is an array which size is @code{__PO_HI_NB_DEVICES}.
For each deivce, it contains all relevant information for their configuration. The configuration
string is deduced from the @code{Configuration} property associated with the device.
@end itemize
@subsubsection Main function
The main function is a function that does all the necessary
initialization before the effective run of the node. This function
is stored in a file called @file{main.c}. This function initializes
the components of the node (protected types, network layer, ...),
creates the tasks and wait that all components are initialized.
The following example shows the main subprogram generated for
the node @code{A} of the @code{Ping} example.
The following example shows the @code{Deployment} package relative to
the node @code{A} of the @code{Ping} example:
@include main.c.texi
@include deployment.h.texi
@c -------------------------------------------------------------------
@node Hosts
......@@ -1505,8 +1489,36 @@ type, we create a generic parameterless nested package.
@node Devices
@section Devices
@c -------------------------------------------------------------------
Devices access buses and gives the ability to communicate with other application
nodes. They access buses, such as Ethernet networks. For each device, we expect
that they are associated with a bus. Then, the device must specify
its implementation internals in an @b{abstract} component.
This abstract component can contain other subcomponents that will be integrated in the system.
In addition, if you want to specify the @b{sending function} of the device, you have
to do that with a subprogram subcomponent called @b{sender}. In the example below,
this function is described and associated with an AADL subprogram.
Also, you can specify an initialization function for your device. In that case,
you should associate an AADL subprogram with your device using the @code{Initialize_Entrypoint} property.
This subprogram will then be called at the initialization of the system. The signature of your subprogram
should be :
@smallexample
void __my_init_function (__po_hi_device_id id);
@end smallexample
In this function, the parameter @code{id} corresponds to the identifier bound to the device. It could
then be used to retrieve configuration parameters using the @code{__po_hi_get_device_naming} function
of PolyORB.
The following example illustrates the modeling of device drivers. It describes a serial device. It
calls an initialization function when the system is initialized. It also specify device drivers internals
with an abstract device. This driver is composed of a @b{sending} function to send data across a bus, as well
as a @b{poller} thread that receives incoming data.
@include devices.texi
FIXME
......
Supports Markdown
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