The FEE Server Control Engine of the ALICE-TRD - Westfälische ...
The FEE Server Control Engine of the ALICE-TRD - Westfälische ...
The FEE Server Control Engine of the ALICE-TRD - Westfälische ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
5 <strong>The</strong> <strong>FEE</strong><strong>Server</strong> <strong>Control</strong> <strong>Engine</strong><br />
i n t hopcount ; / / E x p e c t e d v a l u e o f t h e h o p c o u n t e r f i e l d in<br />
t h e SCSN frame a f t e r a<br />
/ / frame has r e t u r n d from t h i s MCM t o t h e DCS<br />
b o a r d<br />
/ / ( d e f a u l t v a l u e : number o f MCMs in t h e<br />
l i n k p a i r +1)<br />
}MCMInfo ;<br />
Listing 5.2: Structure <strong>of</strong> MCMInfo<br />
After <strong>the</strong> data are transferred to <strong>the</strong> array <strong>the</strong> function SCSNBusBridge::calculateConfig(<br />
void) is called. <strong>The</strong> function calculates <strong>the</strong> o<strong>the</strong>r values in MCMInfo.<br />
First, SCSNBusBridge::calculateConfig(void) loops over <strong>the</strong> array mcm_info and checks<br />
for each element if both variables line_defect and damaged are set to false. If all variables<br />
are set to false, <strong>the</strong> linkpair has no damages. All MCMs remain unbridged and link 0 <strong>of</strong><br />
<strong>the</strong> linkpair is used for sending. <strong>The</strong> variables dest, hopcount and link (see listing 5.2) are<br />
set to default values:<br />
dest = default_slave_address,<br />
hopcount = number_<strong>of</strong>_slaves_in_linkpair,<br />
link = 0.<br />
Second, it is checked if only lines in link 0 but no MCMs are broken. In this case link<br />
1 can be used for <strong>the</strong> SCSN communication and no MCMs need to be bridged. Since<br />
now <strong>the</strong> frames shall travel exactly <strong>the</strong> o<strong>the</strong>r way around compared to using link 0, dest,<br />
hopcount and link get new values:<br />
dest = number_<strong>of</strong>_slaves_in_linkpair−default_slave_address+1,<br />
hopcount = default_slave_address−1,<br />
link = 1.<br />
If ei<strong>the</strong>r at least one MCM in <strong>the</strong> linkpair or lines in both links are broken, <strong>the</strong> linkpair<br />
needs to be bridged. In a first step each error is bridged seperately and <strong>the</strong> status <strong>of</strong> <strong>the</strong><br />
MCMs is set accordingly. Next <strong>the</strong> two outermost MCMs with status bridged are searched<br />
and <strong>the</strong> status <strong>of</strong> all MCMs in between is set to not avaialabe. Finally <strong>the</strong> new addressing<br />
scheme is calculated.<br />
<strong>The</strong> procedure should be illustrated with an example. Assuming, <strong>the</strong> SCSN line in link<br />
0 between <strong>the</strong> MCM with <strong>the</strong> slave ID 4 and 5 is broken and additionally MCM 12 is<br />
damaged (see figure 5.6). In this case <strong>the</strong> function learnConfig(const vector<br />
&, bool [4], int, int) has set <strong>the</strong> variable line_defect[0] for MCM 4 to true and <strong>the</strong> variable<br />
damaged for MCM 12. In a first step calculateConfig(void) sets <strong>the</strong> status <strong>of</strong> <strong>the</strong> MCMs<br />
4 and 5 and <strong>of</strong> <strong>the</strong> MCMs 11 and 13 to bridged. In <strong>the</strong> second step MCM 4 and MCM<br />
13 are identified as <strong>the</strong> both outermost MCMs in bridge mode. <strong>The</strong> status <strong>of</strong> all MCMs<br />
in between is set not avaialabe because <strong>the</strong>se MCMs are not reachable any longer. In <strong>the</strong><br />
last step <strong>the</strong> new addressing scheme is calculated. Listing 5.3 shows <strong>the</strong> corresponding<br />
source code for <strong>the</strong> address recalculation.<br />
Fur<strong>the</strong>rmore <strong>the</strong> expected hopcounter for returning broadcasts has to be calculated.<br />
Due to <strong>the</strong> bridging one has splitted <strong>the</strong> linkpair in two parts and <strong>the</strong>refore two values<br />
have to be calculated, one value for each part <strong>of</strong> <strong>the</strong> linkpair (listing 5.3).<br />
62<br />
for ( i n t s l =1; s l