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
|
This example describes GLADE filtering features. It is based on the
Erathostene algorithm (see other examples). We have three partitions,
each one includes a RCI unit.
P1 : Partition := (prime_1);
P2 : Partition := (prime_2);
P3 : Partition := (prime_3);
Partition P4 ensures the compilation of filtering packages included in
this example. You can discard this partition in the following
explanations.
P4 : Partition := (System.Garlic.Filters.Double,
System.Garlic.Filters.Shift,
System.Garlic.Filters.Reversing);
We declare 2 channels.
C1 : Channel := (P1, P2);
C2 : Channel := (P2, P3);
A channel is a pair of partitions. These partitions have to be
declared before. Some attributes apply on channels (as well as on
partitions).
(1) for Partition'Filter use "double";
This indicates to GLADE that as a default rule, filter "double"
is used between any partition communication.
(2) for Channel'Filter use "shift";
This indicates to GLADE that as a default rule, filter "shift" is used
between 2 partitions when they belong to a channel declared in the
configuration file.
(3) for C1'Filter use "zip";
This indicates to GLADE that filter "zip" is used between P1 and P2.
As a result, we have the following:
Filter "zip" is used between P1 and P2.
Rule (1) applies, but C1 (P1, P2) has been declared. Rule (1) is
overloaded by rule (2). C1 has a representation clause on
it. Therefore, rule (2) is overloaded by rule (3).
Filter "shift" is used between P2 and P3.
Rule (1) applies, but C2 (P2, P3) has been declared. Rule (1) is
overloaded by rule (2).
Filter "double" is used between P1 and P3.
Rule (1) applies.
At last, we have the following configuration :
P1 -- "zip" --> P2 -- "shift" --> P3
^ |
+-------------- "double" -------------+
Filter "shift" generates a key which is used to shift each
message byte. This key is generated dynamically by a partition and has
to be sent to the partition on the other side. This exchange can also
be filtered. This filter is called the registration filter. There is
only one registration filter for the whole configuration. We declare
filter "reversing" as a registration filter with the following
statement:
pragma Registration_Filter ("reversing");
|