Information Technology Reference
In-Depth Information
#include
"builtin"
1
#include
"registrationtable.carml"
2
#include
"p2pconnection.rsl"
3
CIRCUIT
NetworkManager
{
5
// create registration table
6
Table
= new
registrationTable
(
source
[
0
]
,source
[
1
]
,source
[
2
]
,
7
source
[
3
]
,source
[
4
]
,source
[
5
]
,R
;
8
I,J,
9
sink
[
0
]
,sink
[
1
]
,sink
[
2
]
,
10
sink
[
6
]
,sink
[
7
]
,sink
[
8
]);
11
// node A merges the requests
13
for (
i
=
0
;
i
<
3
;
i
=
i+1
){
14
Sync
[
i
] = new
SYNC
(
source
[
i+3
];
A
);
15
}
16
// the requests are beeing buffered in the FIFO1
18
request_buffer
= new
FIFO1
(
A
;
B
);
19
// the buffered request later goes via an exclusive router
21
// into the connections matrix
(
P2PConnection
)
22
new
EXROUTER
<
3
>(
B
;
RI
[
0
]
,RI
[
1
]
,RI
[
2
]);
23
// create P2PConnection to direct requests and answers
25
Connections
= new
P2PConnection
(
I,J,RI
[
0
]
,RI
[
1
]
,RI
[
2
]
,
26
AI
[
0
]
,AI
[
1
]
,AI
[
2
];
27
RO
[
0
]
,RO
[
1
]
,RO
[
2
]
,
28
AO
[
0
]
,AO
[
1
]
,AO
[
2
]);
29
// the answers are merged into a single node C
31
for(
i
=
0
;
i
<
3
;
i
=
i+1
){
32
Sync
[
i+3
] = new
SYNC
(
AI
[
i
];
C
);
33
}
34
// and buffered in the release_buffer for
36
// the later release
(
in the registration table
)
37
release_buffer
= new
FIFO1
(
C
;
R
);
38
// rest of the interface declaration
40
source
[
6
]=
AI
[
0
];
source
[
7
]=
AI
[
1
];
source
[
8
]=
AI
[
2
];
41
sink
[
3
]=
RO
[
0
];
sink
[
4
]=
RO
[
1
];
sink
[
5
]=
RO
[
2
];
42
sink
[
9
]=
AO
[
0
];
sink
[
10
]=
AO
[
1
];
sink
[
11
]=
AO
[
2
];
43
}
44
Fig. 9.
RSL script composing a network manager