31 unsigned short (&eIsoCardId)[4],
32 unsigned short (&eIsoRegionId)[4],
33 unsigned short (&eNonIsoRank)[4],
34 unsigned short (&eNonIsoCardId)[4],
35 unsigned short (&eNonIsoRegionId)[4],
36 unsigned short (&MIPbits)[7][2],
37 unsigned short (&Qbits)[7][2],
38 unsigned short (&SFP)[2][4] )
const{
43 for (
int i=0;
i<7;
i++){
44 for (
int j=0;
j<2;
j++){
45 SFP[0][0] = SFP[0][0]|((MIPbits[
i][
j]&0x01)<<((2*
i)+
j) );
46 SFP[1][0] = SFP[1][0]|((Qbits[
i][
j]&0x01)<<((2*
i)+
j) );
50 SFP[0][1] = (eIsoRank[0]&0x3f)|((eIsoRegionId[0]&0x01)<<6)|((eIsoCardId[0]&0x07)<<7)|((eIsoRank[1]&0x7)<<10);
51 SFP[1][1] = 0x8000|(eIsoRank[2]&0x3f)|((eIsoRegionId[2]&0x01)<<6)|((eIsoCardId[2]&0x07)<<7)|((eIsoRank[3]&0x7)<<10);
52 SFP[0][2] = (eNonIsoRank[0]&0x3f)|((eNonIsoRegionId[0]&0x01)<<6)|((eNonIsoCardId[0]&0x07)<<7)|((eIsoRank[1]&0x38)<<7)|((eIsoRegionId[1]&0x01)<<13);
53 SFP[1][2] = 0x8000|(eNonIsoRank[2]&0x3f)|((eNonIsoRegionId[2]&0x01)<<6)|((eNonIsoCardId[2]&0x07)<<7)|((eIsoRank[3]&0x38)<<7)|((eIsoRegionId[3]&0x01)<<13);
54 SFP[0][3] = (eNonIsoRank[1]&0x3f)|((eNonIsoRegionId[1]&0x01)<<6)|((eNonIsoCardId[1]&0x07)<<7)|((eIsoCardId[1]&0x07)<<10);
55 SFP[1][3] = 0x8000|(eNonIsoRank[3]&0x3f)|((eNonIsoRegionId[3]&0x01)<<6)|((eNonIsoCardId[3]&0x07)<<7)|((eIsoCardId[3]&0x07)<<10);
64 unsigned short (&eIsoCardId)[4],
65 unsigned short (&eIsoRegionId)[4],
66 unsigned short (&eNonIsoRank)[4],
67 unsigned short (&eNonIsoCardId)[4],
68 unsigned short (&eNonIsoRegionId)[4],
69 unsigned short (&MIPbits)[7][2],
70 unsigned short (&Qbits)[7][2],
71 unsigned short (&SFP)[2][4] )
const{
74 for (
int i=0;
i<7;
i++){
75 for (
int j=0;
j<2;
j++){
76 MIPbits[
i][
j] = (SFP[0][0]>>((2*
i)+
j) )&0x1;
77 Qbits[
i][
j] = (SFP[1][0]>>((2*
i)+
j) )&0x1;
81 eIsoRank[0] = SFP[0][1]&0x3f;
82 eIsoRank[1] = ((SFP[0][1]>>10)&0x7)|((SFP[0][2]>>7)&0x38);
83 eIsoRank[2] = SFP[1][1]&0x3f;
84 eIsoRank[3] = ((SFP[1][1]>>10)&0x7)|((SFP[1][2]>>7)&0x38);
86 eNonIsoRank[0] = SFP[0][2]&0x3f;
87 eNonIsoRank[1] = SFP[0][3]&0x3f;
88 eNonIsoRank[2] = SFP[1][2]&0x3f;
89 eNonIsoRank[3] = SFP[1][3]&0x3f;
91 eIsoRegionId[0] = (SFP[0][1]>>6)&0x1;
92 eIsoRegionId[1] = (SFP[0][2]>>13)&0x1;
93 eIsoRegionId[2] = (SFP[1][1]>>6)&0x1;
94 eIsoRegionId[3] = (SFP[1][2]>>13)&0x1;
96 eNonIsoRegionId[0] = (SFP[0][2]>>6)&0x1;
97 eNonIsoRegionId[1] = (SFP[0][3]>>6)&0x1;
98 eNonIsoRegionId[2] = (SFP[1][2]>>6)&0x1;
99 eNonIsoRegionId[3] = (SFP[1][3]>>6)&0x1;
101 eIsoCardId[0] = (SFP[0][1]>>7)&0x7;
102 eIsoCardId[1] = (SFP[0][3]>>10)&0x7;
103 eIsoCardId[2] = (SFP[1][1]>>7)&0x7;
104 eIsoCardId[3] = (SFP[1][3]>>10)&0x7;
106 eNonIsoCardId[0] = (SFP[0][2]>>7)&0x7;
107 eNonIsoCardId[1] = (SFP[0][3]>>7)&0x7;
108 eNonIsoCardId[2] = (SFP[1][2]>>7)&0x7;
109 eNonIsoCardId[3] = (SFP[1][3]>>7)&0x7;
119 unsigned short (&RCof)[7][2],
120 unsigned short (&RCtau)[7][2],
121 unsigned short (&
HF)[4][2],
122 unsigned short (&HFQ)[4][2],
123 unsigned short (&SFP)[2][4])
const{
125 SFP[0][0] = (RC[5][0]&0x3ff)|((RCof[5][0]&0x1)<<10)|((RCtau[5][0]&0x1)<<11)|((HFQ[0][0]&0x1)<<12)|((HFQ[1][0]&0x01)<<13)|((
HF[0][0]&0x01)<<14);
126 SFP[1][0] = 0x8000|(RC[5][1]&0x3ff)|((RCof[5][1]&0x1)<<10)|((RCtau[5][1]&0x1)<<11)|((HFQ[2][0]&0x1)<<12)|((HFQ[3][0]&0x01)<<13)|((
HF[2][0]&0x01)<<14);
127 SFP[0][1] = (RC[6][0]&0x3ff)|((RCof[6][0]&0x1)<<10)|((RCtau[6][0]&0x1)<<11)|((HFQ[0][1]&0x1)<<12)|((HFQ[1][1]&0x01)<<13)|((
HF[0][1]&0x01)<<14);
128 SFP[1][1] = 0x8000|(RC[6][1]&0x3ff)|((RCof[6][1]&0x1)<<10)|((RCtau[6][1]&0x1)<<11)|((HFQ[2][1]&0x1)<<12)|((HFQ[3][1]&0x01)<<13)|((
HF[2][1]&0x01)<<14);
129 SFP[0][2] = ((
HF[0][0]>>1)&0x7f)|((
HF[1][0]&0xff)<<7);
130 SFP[1][2] = 0x8000|((
HF[2][0]>>1)&0x7f)|((
HF[3][0]&0xff)<<7);
131 SFP[0][3] = ((
HF[0][1]>>1)&0x7f)|((
HF[1][1]&0xff)<<7);
132 SFP[1][3] = 0x8000|((
HF[2][1]>>1)&0x7f)|((
HF[3][1]&0xff)<<7);
143 unsigned short (&RCof)[7][2],
144 unsigned short (&RCtau)[7][2],
145 unsigned short (&
HF)[4][2],
146 unsigned short (&HFQ)[4][2],
147 unsigned short (&SFP)[2][4])
const{
149 RC[5][0]=SFP[0][0]&0x3ff;
150 RC[5][1]=SFP[1][0]&0x3ff;
151 RC[6][0]=SFP[0][1]&0x3ff;
152 RC[6][1]=SFP[1][1]&0x3ff;
154 RCof[5][0]=(SFP[0][0]>>10)&0x1;
155 RCof[5][1]=(SFP[1][0]>>10)&0x1;
156 RCof[6][0]=(SFP[0][1]>>10)&0x1;
157 RCof[6][1]=(SFP[1][1]>>10)&0x1;
159 RCtau[5][0]=(SFP[0][0]>>11)&0x1;
160 RCtau[5][1]=(SFP[1][0]>>11)&0x1;
161 RCtau[6][0]=(SFP[0][1]>>11)&0x1;
162 RCtau[6][1]=(SFP[1][1]>>11)&0x1;
164 HFQ[0][0]=(SFP[0][0]>>12)&0x1;
165 HFQ[1][0]=(SFP[0][0]>>13)&0x1;
166 HFQ[2][0]=(SFP[1][0]>>12)&0x1;
167 HFQ[3][0]=(SFP[1][0]>>13)&0x1;
169 HFQ[0][1]=(SFP[0][1]>>12)&0x1;
170 HFQ[1][1]=(SFP[0][1]>>13)&0x1;
171 HFQ[2][1]=(SFP[1][1]>>12)&0x1;
172 HFQ[3][1]=(SFP[1][1]>>13)&0x1;
174 HF[0][0]=((SFP[0][2]&0x7f)<<1)|((SFP[0][0]>>14)&0x01);
175 HF[1][0]=(SFP[0][2]>>7)&0xff;
176 HF[2][0]=((SFP[1][2]&0x7f)<<1)|((SFP[1][0]>>14)&0x01);
177 HF[3][0]=(SFP[1][2]>>7)&0xff;
179 HF[0][1]=((SFP[0][3]&0x7f)<<1)|((SFP[0][1]>>14)&0x01);
180 HF[1][1]=(SFP[0][3]>>7)&0xff;
181 HF[2][1]=((SFP[1][3]&0x7f)<<1)|((SFP[1][1]>>14)&0x01);
182 HF[3][1]=(SFP[1][3]>>7)&0xff;
191 unsigned short (&RCof)[7][2],
192 unsigned short (&RCtau)[7][2],
193 unsigned short (&SFP)[2][4])
const{
195 SFP[0][0] = (RC[0][0]&0x3ff)|((RCof[0][0]&0x1)<<10)|((RCtau[0][0]&0x1)<<11)|((RC[2][0]&0x7)<<12);
196 SFP[1][0] = 0x8000|(RC[0][1]&0x3ff)|((RCof[0][1]&0x1)<<10)|((RCtau[0][1]&0x1)<<11)|((RC[2][1]&0x7)<<12);
198 SFP[0][1] = (RC[1][0]&0x3ff)|((RCof[1][0]&0x1)<<10)|((RCtau[1][0]&0x1)<<11)|((RC[2][0]&0x38)<<9);
199 SFP[1][1] = 0x8000|(RC[1][1]&0x3ff)|((RCof[1][1]&0x1)<<10)|((RCtau[1][1]&0x1)<<11)|((RC[2][1]&0x38)<<9);
201 SFP[0][2] = (RC[0][0]&0x3ff)|((RCof[0][0]&0x1)<<10)|((RCtau[0][0]&0x1)<<11);
202 SFP[1][2] = 0x8000|(RC[0][1]&0x3ff)|((RCof[0][1]&0x1)<<10)|((RCtau[0][1]&0x1)<<11);
204 SFP[0][3] = (RC[1][0]&0x3ff)|((RCof[1][0]&0x1)<<10)|((RCtau[1][0]&0x1)<<11);
205 SFP[1][3] = 0x8000|(RC[1][1]&0x3ff)|((RCof[1][1]&0x1)<<10)|((RCtau[1][1]&0x1)<<11);
214 unsigned short (&RCof)[7][2],
215 unsigned short (&RCtau)[7][2],
216 unsigned short (&SFP)[2][4])
const{
218 RC[0][0]=SFP[0][0]&0x3ff;
219 RC[0][1]=SFP[1][0]&0x3ff;
220 RC[1][0]=SFP[0][1]&0x3ff;
221 RC[1][1]=SFP[1][1]&0x3ff;
222 RC[2][0]=(RC[2][0]&0x3c0)|((SFP[0][0]&0x7000)>>12)|((SFP[0][1]&0x7000)>>9);
223 RC[2][1]=(RC[2][1]&0x3c0)|((SFP[1][0]&0x7000)>>12)|((SFP[1][1]&0x7000)>>9);
225 RCof[0][0]=(SFP[0][0]>>10)&0x1;
226 RCof[0][1]=(SFP[1][0]>>10)&0x1;
227 RCof[1][0]=(SFP[0][1]>>10)&0x1;
228 RCof[1][1]=(SFP[1][1]>>10)&0x1;
230 RCtau[0][0]=(SFP[0][0]>>11)&0x1;
231 RCtau[0][1]=(SFP[1][0]>>11)&0x1;
232 RCtau[1][0]=(SFP[0][1]>>11)&0x1;
233 RCtau[1][1]=(SFP[1][1]>>11)&0x1;
243 unsigned short (&RCof)[7][2],
244 unsigned short (&RCtau)[7][2],
245 unsigned short (&sisterRC)[7][2],
246 unsigned short (&sisterRCof)[7][2],
247 unsigned short (&sisterRCtau)[7][2],
248 unsigned short (&SFP)[2][4])
const{
250 SFP[0][0] = (RC[3][0]&0x3ff)|((RCof[3][0]&0x1)<<10)|((RCtau[3][0]&0x1)<<11)|((RC[2][0]&0x1c0)<<6);
251 SFP[1][0] = 0x8000|(RC[3][1]&0x3ff)|((RCof[3][1]&0x1)<<10)|((RCtau[3][1]&0x1)<<11)|((RC[2][1]&0x1c0)<<6);
253 SFP[0][1] = (RC[4][0]&0x3ff)|((RCof[4][0]&0x1)<<10)|((RCtau[4][0]&0x1)<<11)|((RC[2][0]&0x200)<<3)|((RCof[2][0]&0x1)<<13)|((RCtau[2][0]&0x1)<<14);
254 SFP[1][1] = 0x8000|(RC[4][1]&0x3ff)|((RCof[4][1]&0x1)<<10)|((RCtau[4][1]&0x1)<<11)|((RC[2][1]&0x200)<<3)|((RCof[2][1]&0x1)<<13)|((RCtau[2][1]&0x1)<<14);
256 SFP[0][2] = (sisterRC[3][0]&0x3ff)|((sisterRCof[3][0]&0x1)<<10)|((sisterRCtau[3][0]&0x1)<<11)|((sisterRC[2][0]&0x1c0)<<6);
257 SFP[1][2] = 0x8000|(sisterRC[3][1]&0x3ff)|((sisterRCof[3][1]&0x1)<<10)|((sisterRCtau[3][1]&0x1)<<11)|((sisterRC[2][1]&0x1c0)<<6);
259 SFP[0][3] = (sisterRC[4][0]&0x3ff)|((sisterRCof[4][0]&0x1)<<10)|((sisterRCtau[4][0]&0x1)<<11)|((sisterRC[2][0]&0x200)<<3)|((sisterRCof[2][0]&0x1)<<13)|((sisterRCtau[2][0]&0x1)<<14);
260 SFP[1][3] = 0x8000|(sisterRC[4][1]&0x3ff)|((sisterRCof[4][1]&0x1)<<10)|((sisterRCtau[4][1]&0x1)<<11)|((sisterRC[2][1]&0x200)<<3)|((sisterRCof[2][1]&0x1)<<13)|((sisterRCtau[2][1]&0x1)<<14);
269 unsigned short (&RCof)[7][2],
270 unsigned short (&RCtau)[7][2],
271 unsigned short (&sisterRC)[7][2],
272 unsigned short (&sisterRCof)[7][2],
273 unsigned short (&sisterRCtau)[7][2],
274 unsigned short (&SFP)[2][4])
const{
276 RC[2][0]=(RC[2][0]&0x3f)|((SFP[0][0]&0x7000)>>6)|((SFP[0][1]&0x1000)>>3);
277 RC[3][0]=SFP[0][0]&0x3ff;
278 RC[4][0]=SFP[0][1]&0x3ff;
279 RC[2][1]=(RC[2][1]&0x3f)|((SFP[1][0]&0x7000)>>6)|((SFP[1][1]&0x1000)>>3);
280 RC[3][1]=SFP[1][0]&0x3ff;
281 RC[4][1]=SFP[1][1]&0x3ff;
283 RCof[2][0]=(SFP[0][1]>>13)&0x1;
284 RCof[3][0]=(SFP[0][0]>>10)&0x1;
285 RCof[4][0]=(SFP[0][1]>>10)&0x1;
286 RCof[2][1]=(SFP[1][1]>>13)&0x1;
287 RCof[3][1]=(SFP[1][0]>>10)&0x1;
288 RCof[4][1]=(SFP[1][1]>>10)&0x1;
290 RCtau[2][0]=(SFP[0][1]>>14)&0x1;
291 RCtau[3][0]=(SFP[0][0]>>11)&0x1;
292 RCtau[4][0]=(SFP[0][1]>>11)&0x1;
293 RCtau[2][1]=(SFP[1][1]>>14)&0x1;
294 RCtau[3][1]=(SFP[1][0]>>11)&0x1;
295 RCtau[4][1]=(SFP[1][1]>>11)&0x1;
297 sisterRC[2][0]=(sisterRC[2][0]&~0x3C0)|((SFP[0][2]&0x7000)>>6)|((SFP[0][3]&0x1000)>>3);
298 sisterRC[3][0]=SFP[0][2]&0x3ff;
299 sisterRC[4][0]=SFP[0][3]&0x3ff;
300 sisterRC[2][1]=(sisterRC[2][1]&~0x3C0)|((SFP[1][2]&0x7000)>>6)|((SFP[1][3]&0x1000)>>3);
301 sisterRC[3][1]=SFP[1][2]&0x3ff;
302 sisterRC[4][1]=SFP[1][3]&0x3ff;
304 sisterRCof[2][0]=(SFP[0][3]>>13)&0x1;
305 sisterRCof[3][0]=(SFP[0][2]>>10)&0x1;
306 sisterRCof[4][0]=(SFP[0][3]>>10)&0x1;
307 sisterRCof[2][1]=(SFP[1][3]>>13)&0x1;
308 sisterRCof[3][1]=(SFP[1][2]>>10)&0x1;
309 sisterRCof[4][1]=(SFP[1][3]>>10)&0x1;
311 sisterRCtau[2][0]=(SFP[0][3]>>14)&0x1;
312 sisterRCtau[3][0]=(SFP[0][2]>>11)&0x1;
313 sisterRCtau[4][0]=(SFP[0][3]>>11)&0x1;
314 sisterRCtau[2][1]=(SFP[1][3]>>14)&0x1;
315 sisterRCtau[3][1]=(SFP[1][2]>>11)&0x1;
316 sisterRCtau[4][1]=(SFP[1][3]>>11)&0x1;
327 unsigned short (&SFP)[2][4],
328 unsigned long (&VHDCI)[2][2] )
const{
330 unsigned short sfp_reverse[2][4]={{0}};
332 for (
int i=0;
i<2;
i++){
333 for(
int j=0;
j<4;
j++){
334 for (
int k=0;
k<16;
k++){
335 sfp_reverse[
i][
j]=sfp_reverse[
i][
j]|(((SFP[
i][
j]>>
k)&0x01)<<(15-
k));
341 switch (RoutingMode){
343 VHDCI[0][0]=(SFP[0][1]&0x3ff)|((SFP[0][1]&0x1c00)<<1)|((SFP[0][2]&0x3c00)<<4)|((SFP[0][3]&0x1c00)<<8)|((SFP[0][0]&0xff)<<22);
344 VHDCI[0][1]=(SFP[1][1]&0x3ff)|((SFP[1][1]&0x1c00)<<1)|((SFP[1][2]&0x3c00)<<4)|((SFP[1][3]&0x1c00)<<8)|((SFP[1][0]&0xff)<<22);
345 VHDCI[1][0]=(SFP[0][2]&0x3ff)|((SFP[0][3]&0x3ff)<<11)|((SFP[0][0]&0x3f00)<<14);
346 VHDCI[1][1]=(SFP[1][2]&0x3ff)|((SFP[1][3]&0x3ff)<<11)|((SFP[1][0]&0x3f00)<<14);
349 VHDCI[0][0]=(SFP[0][0]&0xfff)|((SFP[0][1]&0x7)<<12)|((SFP[0][2]&0x80)<<10)|((SFP[0][0]&0x4000)<<4)|((sfp_reverse[0][1]&0xc)<<17)|((sfp_reverse[0][0]&0xc)<<19)|((sfp_reverse[0][1]&0x1ff0)<<19);
350 VHDCI[0][1]=(SFP[1][0]&0xfff)|((SFP[1][1]&0x7)<<12)|((SFP[1][2]&0x80)<<10)|((SFP[1][0]&0x4000)<<4)|((sfp_reverse[1][1]&0xc)<<17)|((sfp_reverse[1][0]&0xc)<<19)|((sfp_reverse[1][1]&0x1ff0)<<19);
352 VHDCI[1][0]=(SFP[0][1]&0x4000)|((SFP[0][3]&0x80)<<24);
353 VHDCI[1][1]=(SFP[1][1]&0x4000)|((SFP[1][3]&0x80)<<24);
355 for (
int i=0;
i<7;
i++){
356 VHDCI[1][0]=VHDCI[1][0]|(((SFP[0][2]>>
i)&0x1)<<(2*
i))|(((SFP[0][2]>>(
i+8))&0x1)<<((2*
i)+1))|(((sfp_reverse[0][3]>>(
i+1))&0x1)<<((2*
i)+17))|(((sfp_reverse[0][3]>>(
i+9))&0x1)<<((2*
i)+18));
357 VHDCI[1][1]=VHDCI[1][1]|(((SFP[1][2]>>
i)&0x1)<<(2*
i))|(((SFP[1][2]>>(
i+8))&0x1)<<((2*
i)+1))|(((sfp_reverse[1][3]>>(
i+1))&0x1)<<((2*
i)+17))|(((sfp_reverse[1][3]>>(
i+9))&0x1)<<((2*
i)+18));
361 VHDCI[0][0]=(SFP[0][0]&0xfff)|((SFP[0][1]&0x7)<<12)|((sfp_reverse[0][1]&0xe)<<16)|((sfp_reverse[0][0]&0xe)<<19)|((sfp_reverse[0][1]&0x1ff0)<<19);
362 VHDCI[0][1]=(SFP[1][0]&0xfff)|((SFP[1][1]&0x7)<<12)|((sfp_reverse[1][1]&0xe)<<16)|((sfp_reverse[1][0]&0xe)<<19)|((sfp_reverse[1][1]&0x1ff0)<<19);
367 VHDCI[0][0]=((SFP[0][0]>>12)&0x7)|((SFP[0][1]>>9)&0x38)|((SFP[0][0]&0x1ff)<<6)|((sfp_reverse[0][1]&0xfff0)<<13)|((sfp_reverse[0][0]&0x70)<<25);
368 VHDCI[0][1]=((SFP[1][0]>>12)&0x7)|((SFP[1][1]>>9)&0x38)|((SFP[1][0]&0x1ff)<<6)|((sfp_reverse[1][1]&0xfff0)<<13)|((sfp_reverse[1][0]&0x70)<<25);
370 VHDCI[1][0]=((SFP[0][2]>>12)&0x7)|((SFP[0][3]>>9)&0x38)|((SFP[0][2]&0x1ff)<<6)|((sfp_reverse[0][3]&0xfff0)<<13)|((sfp_reverse[0][2]&0x70)<<25);
371 VHDCI[1][1]=((SFP[1][2]>>12)&0x7)|((SFP[1][3]>>9)&0x38)|((SFP[1][2]&0x1ff)<<6)|((sfp_reverse[1][3]&0xfff0)<<13)|((sfp_reverse[1][2]&0x70)<<25);
386 unsigned short (&SFP)[2][4],
387 unsigned long (&VHDCI)[2][2] )
const{
389 unsigned short VHDCI_reverse[2][4]={{0}};
391 for (
int i=0;
i<2;
i++){
392 for(
int j=0;
j<2;
j++){
393 for (
int k=0;
k<32;
k++){
394 VHDCI_reverse[
i][
j]=VHDCI_reverse[
i][
j]|(((VHDCI[
i][
j]>>
k)&0x01)<<(31-
k));
399 switch (RoutingMode){
401 SFP[0][0]=((VHDCI[0][0]>>22)&0xff)|((VHDCI[1][0]>>14)&0x3f00);
402 SFP[1][0]=0x8000|((VHDCI[0][1]>>22)&0xff)|((VHDCI[1][1]>>14)&0x3f00);
403 SFP[0][1]=(VHDCI[0][0]&0x3ff)|((VHDCI[0][0]>>1)&0x1c00);
404 SFP[1][1]=0x8000|(VHDCI[0][1]&0x3ff)|((VHDCI[0][1]>>1)&0x1c00);
405 SFP[0][2]=(VHDCI[1][0]&0x3ff)|((VHDCI[0][0]>>4)&0x3c00);
406 SFP[1][2]=0x8000|(VHDCI[1][1]&0x3ff)|((VHDCI[0][1]>>4)&0x3c00);
407 SFP[0][3]=((VHDCI[1][0]>>11)&0x3ff)|((VHDCI[0][0]>>8)&0x1c00);
408 SFP[1][3]=0x8000|((VHDCI[1][1]>>11)&0x3ff)|((VHDCI[0][1]>>8)&0x1c00);
411 SFP[0][0]=(VHDCI[0][0]&0xfff)|((VHDCI_reverse[0][0]&0x600)<<3)|((VHDCI_reverse[0][0]&0x2000)<<1);
412 SFP[1][0]=0x8000|(VHDCI[0][1]&0xfff)|((VHDCI_reverse[0][1]&0x600)<<3)|((VHDCI_reverse[0][1]&0x2000)<<1);
413 SFP[0][1]=((VHDCI[0][0]&0x7000)>>12)|((VHDCI_reverse[0][0]&0x1ff)<<3)|((VHDCI_reverse[0][0]&0x1800)<<1)|(VHDCI[1][0]&0x4000);
414 SFP[1][1]=0x8000|((VHDCI[0][1]&0x7000)>>12)|((VHDCI_reverse[0][1]&0x1ff)<<3)|((VHDCI_reverse[0][1]&0x1800)<<1)|(VHDCI[1][1]&0x4000);
416 SFP[0][2]=((VHDCI[0][0]&0x20000)>>10);
417 SFP[1][2]=0x8000|((VHDCI[0][1]&0x20000)>>10);
418 SFP[0][3]=((VHDCI[1][0]&0x20000)>>3);
419 SFP[1][3]=0x8000|((VHDCI[1][1]&0x20000)>>3);
420 for (
int i=0;
i<7;
i++){
421 SFP[0][2]=SFP[0][2]|(((VHDCI[1][0]>>(2*
i))&0x1)<<
i)|(((VHDCI[1][0]>>((2*
i)+1))&0x1)<<(
i+8));
422 SFP[1][2]=SFP[1][2]|(((VHDCI[1][1]>>(2*
i))&0x1)<<
i)|(((VHDCI[1][1]>>((2*
i)+1))&0x1)<<(
i+8));
423 SFP[0][3]=SFP[0][3]|(((VHDCI_reverse[1][0]>>((2*
i)+1))&0x1)<<
i)|(((VHDCI_reverse[1][0]>>(2*
i))&0x1)<<(
i+7));
424 SFP[1][3]=SFP[1][3]|(((VHDCI_reverse[1][1]>>((2*
i)+1))&0x1)<<
i)|(((VHDCI_reverse[1][1]>>(2*
i))&0x1)<<(
i+7));
428 SFP[0][0]=(VHDCI[0][0]&0xfff)|((VHDCI_reverse[0][0]&0xe00)<<3);
429 SFP[1][0]=0x8000|(VHDCI[0][1]&0xfff)|((VHDCI_reverse[0][1]&0xe00)<<3);
430 SFP[0][1]=((VHDCI[0][0]&0x7000)>>12)|((VHDCI_reverse[0][0]&0x1ff)<<3)|(VHDCI_reverse[0][0]&0x7000);
431 SFP[1][1]=0x8000|((VHDCI[0][1]&0x7000)>>12)|((VHDCI_reverse[0][1]&0x1ff)<<3)|(VHDCI_reverse[0][1]&0x7000);
432 SFP[0][2]=(VHDCI[0][0]&0xfff);
433 SFP[1][2]=0x8000|(VHDCI[0][1]&0xfff);
434 SFP[0][3]=((VHDCI[0][0]&0x7000)>>12)|((VHDCI_reverse[0][0]&0x1ff)<<3);
435 SFP[1][3]=0x8000|((VHDCI[0][1]&0x7000)>>12)|((VHDCI_reverse[0][1]&0x1ff)<<3);
438 SFP[0][0]=((VHDCI[0][0]&0x7fc0)>>6)|((VHDCI_reverse[0][0]&0x7)<<9)|((VHDCI[0][0]&0x7)<<12);
439 SFP[1][0]=0x8000|((VHDCI[0][1]&0x7fc0)>>6)|((VHDCI_reverse[0][1]&0x7)<<9)|((VHDCI[0][1]&0x7)<<12);
440 SFP[0][1]=((VHDCI_reverse[0][0]&0x7ff8)>>3)|((VHDCI[0][0]&0x38)<<9);
441 SFP[1][1]=0x8000|((VHDCI_reverse[0][1]&0x7ff8)>>3)|((VHDCI[0][1]&0x38)<<9);
442 SFP[0][2]=((VHDCI[1][0]&0x7fc0)>>6)|((VHDCI_reverse[1][0]&0x7)<<9)|((VHDCI[1][0]&0x7)<<12);
443 SFP[1][2]=0x8000|((VHDCI[1][1]&0x7fc0)>>6)|((VHDCI_reverse[1][1]&0x7)<<9)|((VHDCI[1][1]&0x7)<<12);
444 SFP[0][3]=((VHDCI_reverse[1][0]&0x7ff8)>>3)|((VHDCI[1][0]&0x38)<<9);
445 SFP[1][3]=0x8000|((VHDCI_reverse[1][1]&0x7ff8)>>3)|((VHDCI[1][1]&0x38)<<9);
466 unsigned short (&eIsoCardId)[4],
467 unsigned short (&eIsoRegionId)[4],
468 unsigned short (&eNonIsoRank)[4],
469 unsigned short (&eNonIsoCardId)[4],
470 unsigned short (&eNonIsoRegionId)[4],
471 unsigned short (&MIPbits)[7][2],
472 unsigned short (&Qbits)[7][2],
473 unsigned long (&VHDCI)[2][2] )
const{
475 unsigned short SFP[2][4]={{0}};
476 EMUtoSFP(eIsoRank,eIsoCardId,eIsoRegionId,eNonIsoRank,eNonIsoCardId,eNonIsoRegionId,MIPbits,Qbits,SFP);
477 SFPtoVHDCI(0,SFP,VHDCI);
487 unsigned short (&eIsoCardId)[4],
488 unsigned short (&eIsoRegionId)[4],
489 unsigned short (&eNonIsoRank)[4],
490 unsigned short (&eNonIsoCardId)[4],
491 unsigned short (&eNonIsoRegionId)[4],
492 unsigned short (&MIPbits)[7][2],
493 unsigned short (&Qbits)[7][2],
494 unsigned long (&VHDCI)[2][2] )
const{
496 unsigned short SFP[2][4]={{0}};
497 VHDCItoSFP(0,SFP,VHDCI);
498 SFPtoEMU(eIsoRank,eIsoCardId,eIsoRegionId,eNonIsoRank,eNonIsoCardId,eNonIsoRegionId,MIPbits,Qbits,SFP);
512 unsigned short (&RCof)[7][2],
513 unsigned short (&RCtau)[7][2],
514 unsigned short (&
HF)[4][2],
515 unsigned short (&HFQ)[4][2],
516 unsigned long (&VHDCI)[2][2] )
const{
518 unsigned short SFP[2][4]={{0}};
519 RC56HFtoSFP(RC,RCof,RCtau,
HF,HFQ,SFP);
520 SFPtoVHDCI(1,SFP,VHDCI);
530 unsigned short (&RCof)[7][2],
531 unsigned short (&RCtau)[7][2],
532 unsigned short (&
HF)[4][2],
533 unsigned short (&HFQ)[4][2],
534 unsigned long (&VHDCI)[2][2] )
const{
536 unsigned short SFP[2][4]={{0}};
537 VHDCItoSFP(1,SFP,VHDCI);
538 SFPtoRC56HF(RC,RCof,RCtau,
HF,HFQ,SFP);
547 unsigned short (&RCof)[7][2],
548 unsigned short (&RCtau)[7][2],
549 unsigned long (&VHDCI)[2][2] )
const{
551 unsigned short SFP[2][4]={{0}};
552 RC012toSFP(RC,RCof,RCtau,SFP);
553 SFPtoVHDCI(2,SFP,VHDCI);
561 unsigned short (&RCof)[7][2],
562 unsigned short (&RCtau)[7][2],
563 unsigned long (&VHDCI)[2][2] )
const{
565 unsigned short SFP[2][4]={{0}};
566 VHDCItoSFP(2,SFP,VHDCI);
567 SFPtoRC012(RC,RCof,RCtau,SFP);
576 unsigned short (&RCof)[7][2],
577 unsigned short (&RCtau)[7][2],
578 unsigned short (&sisterRC)[7][2],
579 unsigned short (&sisterRCof)[7][2],
580 unsigned short (&sisterRCtau)[7][2],
581 unsigned long (&VHDCI)[2][2] )
const{
583 unsigned short SFP[2][4]={{0}};
584 RC234toSFP(RC,RCof,RCtau,sisterRC,sisterRCof,sisterRCtau,SFP);
585 SFPtoVHDCI(3,SFP,VHDCI);
594 unsigned short (&RCof)[7][2],
595 unsigned short (&RCtau)[7][2],
596 unsigned short (&sisterRC)[7][2],
597 unsigned short (&sisterRCof)[7][2],
598 unsigned short (&sisterRCtau)[7][2],
599 unsigned long (&VHDCI)[2][2] )
const{
601 unsigned short SFP[2][4]={{0}};
602 VHDCItoSFP(3,SFP,VHDCI);
603 SFPtoRC234(RC,RCof,RCtau,sisterRC,sisterRCof,sisterRCtau,SFP);
613 unsigned short &eventNumber,
614 unsigned short (&eIsoRank)[4],
615 unsigned short (&eIsoCardId)[4],
616 unsigned short (&eIsoRegionId)[4],
617 unsigned short (&eNonIsoRank)[4],
618 unsigned short (&eNonIsoCardId)[4],
619 unsigned short (&eNonIsoRegionId)[4],
620 unsigned short (&MIPbits)[7][2],
621 unsigned short (&Qbits)[7][2],
624 unsigned long VHDCI[2][2]={{0}};
625 EMUtoVHDCI(eIsoRank,eIsoCardId,eIsoRegionId,eNonIsoRank,eNonIsoCardId,eNonIsoRegionId,MIPbits,Qbits,VHDCI);
626 VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
636 unsigned short &eventNumber,
637 unsigned short (&RC)[7][2],
638 unsigned short (&RCof)[7][2],
639 unsigned short (&RCtau)[7][2],
640 unsigned short (&
HF)[4][2],
641 unsigned short (&HFQ)[4][2],
644 unsigned long VHDCI[2][2]={{0}};
645 RC56HFtoVHDCI(RC,RCof,RCtau,
HF,HFQ,VHDCI);
646 VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
655 unsigned short &eventNumber,
656 unsigned short (&RC)[7][2],
657 unsigned short (&RCof)[7][2],
658 unsigned short (&RCtau)[7][2],
661 unsigned long VHDCI[2][2]={{0}};
662 RC012toVHDCI(RC,RCof,RCtau,VHDCI);
663 VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
672 unsigned short &eventNumber,
673 unsigned short (&RC)[7][2],
674 unsigned short (&RCof)[7][2],
675 unsigned short (&RCtau)[7][2],
676 unsigned short (&sisterRC)[7][2],
677 unsigned short (&sisterRCof)[7][2],
678 unsigned short (&sisterRCtau)[7][2],
681 unsigned long VHDCI[2][2]={{0}};
682 RC234toVHDCI(RC,RCof,RCtau,sisterRC,sisterRCof,sisterRCtau,VHDCI);
683 VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
692 unsigned short &eventNumber,
694 unsigned short (&SFP)[2][4],
697 unsigned long VHDCI[2][2]={{0}};
698 SFPtoVHDCI(RoutingMode,SFP,VHDCI);
699 VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
708 unsigned short &eventNumber,
710 unsigned long (&VHDCI)[2][2] )
const{
715 temp << dataString << std::endl;
716 temp >>
dec >> eventNumber;
717 temp >>
dec >> logicalCardID;
718 temp >> hex >> VHDCI[0][0];
719 temp >> hex >> VHDCI[0][1];
720 temp >> hex >> VHDCI[1][0];
721 temp >> hex >> VHDCI[1][1];
736 unsigned short &eventNumber,
738 unsigned long (&VHDCI)[2][2] )
const{
742 temp <<
dec << eventNumber <<
'\t';
743 temp <<
dec << logicalCardID <<
'\t';
744 temp << hex << setw(8) << setfill(
'0') << VHDCI[0][0] <<
'\t';
745 temp << hex << setw(8) << setfill(
'0') << VHDCI[0][1] <<
'\t';
746 temp << hex << setw(8) << setfill(
'0') << VHDCI[1][0] <<
'\t';
747 temp << hex << setw(8) << setfill(
'0') << VHDCI[1][1] << std::endl;
748 dataString = temp.str();
756 int &RCTCrateNumber )
const{
758 RCTCrateNumber = (logicalCardID>>3);
759 if ( (logicalCardID&0x4) != 0)RCTCrateNumber+=9;
760 RoutingMode = (logicalCardID&0x3);
768 int &RCTCrateNumber )
const{
770 logicalCardID = ((RCTCrateNumber%9)<<3)|(RCTCrateNumber>8?0x4:0x0)|(RoutingMode&0x3);
void SFPtoRC56HF(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&HF)[4][2], unsigned short(&HFQ)[4][2], unsigned short(&SFP)[2][4]) const
void RC012toSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], std::string &dataString) const
void SFPtoRC012(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&SFP)[2][4]) const
void VHDCItoEMU(unsigned short(&eIsoRank)[4], unsigned short(&eIsoCardId)[4], unsigned short(&eIsoRegionId)[4], unsigned short(&eNonIsoRank)[4], unsigned short(&eNonIsoCardId)[4], unsigned short(&eNonIsoRegionId)[4], unsigned short(&MIPbits)[7][2], unsigned short(&Qbits)[7][2], unsigned long(&VHDCI)[2][2]) const
void SFPtoSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, int RoutingMode, unsigned short(&SFP)[2][4], std::string &dataString) const
void SFPtoEMU(unsigned short(&eIsoRank)[4], unsigned short(&eIsoCardId)[4], unsigned short(&eIsoRegionId)[4], unsigned short(&eNonIsoRank)[4], unsigned short(&eNonIsoCardId)[4], unsigned short(&eNonIsoRegionId)[4], unsigned short(&MIPbits)[7][2], unsigned short(&Qbits)[7][2], unsigned short(&SFP)[2][4]) const
void VHDCItoRC012(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned long(&VHDCI)[2][2]) const
void SFPtoRC234(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&sisterRC)[7][2], unsigned short(&sisterRCof)[7][2], unsigned short(&sisterRCtau)[7][2], unsigned short(&SFP)[2][4]) const
void RC234toSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&sisterRC)[7][2], unsigned short(&sisterRCof)[7][2], unsigned short(&sisterRCtau)[7][2], std::string &dataString) const
void RoutingModetoLogicalCardID(unsigned short &logicalCardID, int &RoutingMode, int &RCTCrateNumber) const
void RC234toSFP(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&sisterRC)[7][2], unsigned short(&sisterRCof)[7][2], unsigned short(&sisterRCtau)[7][2], unsigned short(&SFP)[2][4]) const
void EMUtoSFP(unsigned short(&eIsoRank)[4], unsigned short(&eIsoCardId)[4], unsigned short(&eIsoRegionId)[4], unsigned short(&eNonIsoRank)[4], unsigned short(&eNonIsoCardId)[4], unsigned short(&eNonIsoRegionId)[4], unsigned short(&MIPbits)[7][2], unsigned short(&Qbits)[7][2], unsigned short(&SFP)[2][4]) const
void EMUtoVHDCI(unsigned short(&eIsoRank)[4], unsigned short(&eIsoCardId)[4], unsigned short(&eIsoRegionId)[4], unsigned short(&eNonIsoRank)[4], unsigned short(&eNonIsoCardId)[4], unsigned short(&eNonIsoRegionId)[4], unsigned short(&MIPbits)[7][2], unsigned short(&Qbits)[7][2], unsigned long(&VHDCI)[2][2]) const
void VHDCItoSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, std::string &dataString, unsigned long(&VHDCI)[2][2]) const
void EMUtoSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, unsigned short(&eIsoRank)[4], unsigned short(&eIsoCardId)[4], unsigned short(&eIsoRegionId)[4], unsigned short(&eNonIsoRank)[4], unsigned short(&eNonIsoCardId)[4], unsigned short(&eNonIsoRegionId)[4], unsigned short(&MIPbits)[7][2], unsigned short(&Qbits)[7][2], std::string &dataString) const
void VHDCItoRC56HF(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&HF)[4][2], unsigned short(&HFQ)[4][2], unsigned long(&VHDCI)[2][2]) const
void RC56HFtoVHDCI(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&HF)[4][2], unsigned short(&HFQ)[4][2], unsigned long(&VHDCI)[2][2]) const
void SFPtoVHDCI(int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
void RC56HFtoSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&HF)[4][2], unsigned short(&HFQ)[4][2], std::string &dataString) const
void VHDCItoRC234(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&sisterRC)[7][2], unsigned short(&sisterRCof)[7][2], unsigned short(&sisterRCtau)[7][2], unsigned long(&VHDCI)[2][2]) const
void VHDCItoSFP(int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
void STRINGtoVHDCI(unsigned short &logicalCardID, unsigned short &eventNumber, std::string &dataString, unsigned long(&VHDCI)[2][2]) const
void RC012toSFP(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&SFP)[2][4]) const
void RC012toVHDCI(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned long(&VHDCI)[2][2]) const
void RC234toVHDCI(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&sisterRC)[7][2], unsigned short(&sisterRCof)[7][2], unsigned short(&sisterRCtau)[7][2], unsigned long(&VHDCI)[2][2]) const
void LogicalCardIDtoRoutingMode(unsigned short &logicalCardID, int &RoutingMode, int &RCTCrateNumber) const
void RC56HFtoSFP(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&HF)[4][2], unsigned short(&HFQ)[4][2], unsigned short(&SFP)[2][4]) const