Cat
FEB_v1.cpp
Go to the documentation of this file.
1 // $Id: $
2 // Include files
3 
4 
5 // local
6 #include "FEB_v1.h"
7 #include "SeqPGA.h"
8 
9 //-----------------------------------------------------------------------------
10 // Implementation file for class : FEB_v1
11 //
12 // 2006-10-23 :
13 //-----------------------------------------------------------------------------
14 
15 //=============================================================================
16 // Standard constructor, initializes variables
17 //=============================================================================
19  setName("FEB_v1");
20  setType("FEB_v1");
22 
23  m_fifoDepth = 1024;
24 
25  m_feAddress[0] = 1;
26  m_feAddress[1] = 2;
27  m_feAddress[2] = 5;
28  m_feAddress[3] = 6;
29  m_feAddress[4] = 9;
30  m_feAddress[5] = 10;
31  m_feAddress[6] = 13;
32  m_feAddress[7] = 14;
33 
34  m_seqAddress = 17 ;
35 
36  m_gbtAddress[0] = 1;
37  m_gbtAddress[1] = 2;
38  m_gbtAddress[2] = 3;
39  m_gbtAddress[3] = 4;
40 
41  m_icecalAddress[0] = 3;
42  m_icecalAddress[1] = 4;
43  m_icecalAddress[2] = 7;
44  m_icecalAddress[3] = 8;
45  m_icecalAddress[4] = 11;
46  m_icecalAddress[5] = 12;
47  m_icecalAddress[6] = 15;
48  m_icecalAddress[7] = 16;
49 
50  m_fifoSpyAddress[0] = 20;
51  m_fifoSpyAddress[1] = 21;
52  m_fifoSpyAddress[2] = 22;
53 
54  m_fifoInjectAddress[0] = 23;
55  m_fifoInjectAddress[1] = 24;
56  m_fifoInjectAddress[2] = 25;
57 
58  m_fifoLLTAddress[0] = 26;
59  m_fifoLLTAddress[1] = 27;
60  m_fifoLLTAddress[2] = 29;
61 
62  m_fifoTrigAddress[0] = 10;
63  m_fifoTrigAddress[1] = 11;
64  m_fifoTrigAddress[2] = 17;
65 
66  m_seqPga =new SeqPGA();
67  m_seqPga->setName("SeqPGA");
69 
70  m_fifo[0] = new unsigned int[m_fifoDepth];
71  m_fifo[1] = new unsigned int[m_fifoDepth];
72  m_fifo[2] = new unsigned int[m_fifoDepth];
73 
74  m_ch[0] = new int[m_fifoDepth];
75  m_ch[1] = new int[m_fifoDepth];
76  m_ch[2] = new int[m_fifoDepth];
77  m_ch[3] = new int[m_fifoDepth];
78 
79  for (int i = 0; i<3; ++i){
80  m_ramInj[i] = new RAM();
81  m_ramSpy[i] = new RAM();
82  seqPga()->usb()->addChild(m_ramInj[i]);
83  seqPga()->usb()->addChild(m_ramSpy[i]);
84  m_ramInj[i]->setAddress(13); // for debug
86  m_ramInj[i]->setSize(16, m_fifoDepth);
87  m_ramSpy[i]->setSize(16, m_fifoDepth);
88  }
89 
90  m_fifoUsbTest = new RAM();
92  m_fifoUsbTest->setSize(16,256);
93  m_fifoUsbTest->setName("FifoUsbTest");
95 
96  m_data = new Data();
97  for (int ch=0; ch<32; ++ch){
98  m_data->addDataStream("ch"+itos(ch), "Channel "+itos(ch));
99  }
100  m_data->addDataStream("llt_fifo0", "llt_fifo0");
101  m_data->addDataStream("llt_fifo1", "llt_fifo1");
102 
103 }
104 //=============================================================================
105 // Destructor
106 //=============================================================================
108 }
109 
110 //=============================================================================
111 //
112 //=============================================================================
113 void FEB_v1::readFifo( int add, int subadd, unsigned int *fifo){
114  m_seqPga->spiRead(subadd, m_fifoDepth, fifo);
115 }
116 
117 //=============================================================================
118 //
119 //=============================================================================
120 
121 void FEB_v1::readFifoSpyFE( int fe, int dump=0){
122 
124 
125  debug("Reading fifo 0","FEB_v1::readFifoSpyFE");
127  debug("Reading fifo 1","FEB_v1::readFifoSpyFE");
129  debug("Reading fifo 2","FEB_v1::readFifoSpyFE");
131 
132  char buffer[100];
133 
134  int depth = testDuration(fe);
135  for (int ch=0; ch<4; ++ch){
136  m_data->clear(4*fe+ch);
137  }
138 
139  for (int d=0; d<depth; ++d){
140  m_ch[0][d]=m_fifo[0][d]&0x0FFF;
141  m_ch[1][d]=(((m_fifo[0][d]&0xF000)>>12)+((m_fifo[1][d]&0x00FF)<<4))&0xFFF;
142  m_ch[2][d]=(((m_fifo[1][d]&0xFF00)>>8)+((m_fifo[2][d]&0x000F)<<8))&0xFFF;
143  m_ch[3][d]=(m_fifo[2][d]&0xFFF0)>>4;
144  for (int ch=0; ch<4; ++ch){
145  m_data->dataFill(4*fe+ch , m_ch[ch][d]);
146  }
147  if (dump>0) {
148  sprintf(buffer,"%5d : %5d %5d %5d %5d | %5d %5d %5d", d,
149  m_ch[0][d], m_ch[1][d], m_ch[2][d], m_ch[3][d],
150  m_fifo[0][d], m_fifo[1][d], m_fifo[2][d]);
151  info(buffer,"FEB_v1::readFifoSpyFE");
152  }
153  }
154 }
155 
156 //=============================================================================
157 //
158 //=============================================================================
159 
160 void FEB_v1::readFifoLLTFE( int fe, int dump=0){
161 
162  m_seqPga->setSpiGBTSCA (false) ;
163  info("Reading fifo 0","FEB_v1::readFifoLLTFE");
165  info("Reading fifo 1","FEB_v1::readFifoLLTFE");
167  info("Reading fifo 2","FEB_v1::readFifoLLTFE");
169 
170  char buffer[100];
171 
172  int depth = testDuration(fe);
173 
174  for (int ch=0; ch<4; ++ch){
175  m_data->clear(4*fe+ch);
176  }
177 
178  for (int d=0; d<depth; ++d){
179  m_ch[0][d]=m_fifo[0][d]&0x3FF;
180  m_ch[1][d]=(((m_fifo[0][d])>>10)+((m_fifo[1][d]&0xF)<<6))&0x3FF;
181  m_ch[2][d]=((m_fifo[1][d]&0x3FF0)>>4);
182  m_ch[3][d]=m_fifo[2][d]&0x3FF;
183  for (int ch=0; ch<4; ++ch){
184  m_data->dataFill(4*fe+ch , m_ch[ch][d]);
185  }
186  if (dump>0) {
187  sprintf(buffer,"%5d : %5d %5d %5d %5d | %5d %5d %5d", d,
188  m_ch[0][d], m_ch[1][d], m_ch[2][d], m_ch[3][d],
189  m_fifo[0][d], m_fifo[1][d], m_fifo[2][d]);
190  info(buffer,"FEB_v1::readFifoLLTFE");
191  }
192  }
193 }
194 
195 
196 //=============================================================================
197 //
198 //=============================================================================
199 
200 void FEB_v1::readFifoLLT(int dump=0){
201 
202  m_seqPga->setSpiGBTSCA (false) ;
203  info("Reading fifo 0","FEB_v1::readFifoLLT");
205  info("Reading fifo 1","FEB_v1::readFifoLLT");
207  info("Reading fifo 2","FEB_v1::readFifoLLT");
209 
210  char buffer[100];
211  int depth = testDuration(-1);
212 
213  m_data->clear(32);
214  m_data->clear(33);
215 
216  for (int d=0; d<depth; ++d){
217  m_data->dataFill(32, m_fifo[0][d]);
218  m_data->dataFill(33, m_fifo[1][d]);
219  if (dump>0) {
220  sprintf(buffer,
221  "%5d : ETtot=%4d ETmax=%4d [%2d] Mult=%2d Bx=%4d (%4d) | %5d %5d %5d",
222  d,
223  (m_fifo[0][d])&0x7FF, (m_fifo[1][d])&0x3FF,
224  (m_fifo[0][d]>>11)&0x1F,(m_fifo[1][d]>>10)&0x3F,
225  (m_fifo[2][d]>>10)&0x3F,(m_fifo[2][d])&0x3FF,
226  m_fifo[0][d], m_fifo[1][d], m_fifo[2][d]);
227  info(buffer,"FEB_v1::readFifoLLT");
228  }
229  }
230 }
231 
232 //=============================================================================
233 //
234 //=============================================================================
235 
236 void FEB_v1::readFifoInjectFE( int fe, int dump=0){
237  setInjectModeFE(fe, false);
238  m_seqPga->setSpiGBTSCA (false);
239  info("Reading fifo 0","FEB_v1::readFifoInjectFE");
241  info("Reading fifo 1","FEB_v1::readFifoInjectFE");
243  info("Reading fifo 2","FEB_v1::readFifoInjectFE");
245 
246  char buffer[100];
247  int depth = testDuration(fe);
248  for (int d=0; d<depth; ++d){
249  m_ch[0][d]=m_fifo[0][d]&0x0FFF;
250  m_ch[1][d]=(((m_fifo[0][d]&0xF000)>>12)+((m_fifo[1][d]&0x00FF)<<4))&0xFFF;
251  m_ch[2][d]=(((m_fifo[1][d]&0xFF00)>>8)+((m_fifo[2][d]&0x000F)<<8))&0xFFF;
252  m_ch[3][d]=((m_fifo[2][d]&0xFFF0)>>4)&0xFFF;
253  if (dump>0) {
254  sprintf(buffer,"%5d : %5d %5d %5d %5d | %5d %5d %5d", d,
255  m_ch[0][d], m_ch[1][d], m_ch[2][d], m_ch[3][d],
256  m_fifo[0][d], m_fifo[1][d], m_fifo[2][d]);
257  info(buffer,"FEB_v1::readFifoInjectFE");
258  }
259  }
260  setInjectModeFE(fe, true);
261 }
262 
263 //=============================================================================
264 //
265 //=============================================================================
267  setSpyModeFE(fe, false);
268  int depth = testDuration(fe);
269  for (int d=0; d<depth; ++d){
270  m_fifo[0][d]=d;
271  m_fifo[1][d]=d;
272  m_fifo[2][d]=d;
273  }
274  m_seqPga->spiWrite( m_fifoSpyAddress[0], depth, m_fifo[0] );
275  m_seqPga->spiWrite( m_fifoSpyAddress[1], depth, m_fifo[1] );
276  m_seqPga->spiWrite( m_fifoSpyAddress[2], depth, m_fifo[2] );
277  setSpyModeFE(fe, true);
278 }
279 
280 //=============================================================================
281 //
282 //=============================================================================
285  int depth = testDuration(-1);
286 
287  for (int d=0; d<depth; ++d){
288  m_fifo[0][d]=d;
289  m_fifo[1][d]=d;
290  }
291  m_seqPga->spiWrite( m_fifoTrigAddress[0], depth, m_fifo[0] );
292  m_seqPga->spiWrite( m_fifoTrigAddress[1], depth, m_fifo[1] );
293 }
294 
295 //=============================================================================
296 //
297 //=============================================================================
298 void FEB_v1::writeFifoInjectFE( int fe, int pattern){
300  int depth = testDuration(fe);
301 
302  unsigned int buffer[depth];
303  warning("Spi write mode block disabled !!!","FEB_v1::writeFifoInjectFE");
304  switch(pattern){
305  default: info ("Incremented pattern injection","FEB_v1::writeFifoInjectFE"); break;
306  case 1: info ("ZERO pattern injection","FEB_v1::writeFifoInjectFE"); break;
307  case 2: info ("ZERO and ONE pattern injection","FEB_v1::writeFifoInjectFE"); break;
308  case 10: info ("Channel 0 - Static ONE pattern injection","FEB_v1::writeFifoInjectFE"); break;
309  case 11: info ("Channel 1 - Static ONE pattern injection","FEB_v1::writeFifoInjectFE"); break;
310  case 12: info ("Channel 2 - Static ONE pattern injection","FEB_v1::writeFifoInjectFE"); break;
311  case 13: info ("Channel 3 - Static ONE pattern injection","FEB_v1::writeFifoInjectFE"); break;
312  case 20: info ("Channel 0 - 1/3 ONE pattern injection","FEB_v1::writeFifoInjectFE"); break;
313  case 21: info ("Channel 1 - 1/3 ONE pattern injection","FEB_v1::writeFifoInjectFE"); break;
314  case 22: info ("Channel 2 - 1/3 ONE pattern injection","FEB_v1::writeFifoInjectFE"); break;
315  case 23: info ("Channel 3 - 1/3 ONE pattern injection","FEB_v1::writeFifoInjectFE"); break;
316  case 30: info ("Channel 0 - 1/3 0xAAA pattern injection","FEB_v1::writeFifoInjectFE"); break;
317  case 31: info ("Channel 1 - 1/3 0xAAA pattern injection","FEB_v1::writeFifoInjectFE"); break;
318  case 32: info ("Channel 2 - 1/3 0xAAA pattern injection","FEB_v1::writeFifoInjectFE"); break;
319  case 33: info ("Channel 3 - 1/3 0xAAA pattern injection","FEB_v1::writeFifoInjectFE"); break;
320  case 40: info ("Channel 0 - pow(2,i), i being the word index modulo 12","FEB_v1::writeFifoInjectFE"); break;
321  case 41: info ("Channel 1 - pow(2,i), i being the word index modulo 12","FEB_v1::writeFifoInjectFE"); break;
322  case 42: info ("Channel 2 - pow(2,i), i being the word index modulo 12","FEB_v1::writeFifoInjectFE"); break;
323  case 43: info ("Channel 3 - pow(2,i), i being the word index modulo 12","FEB_v1::writeFifoInjectFE"); break;
324  case 100: info ("Pulse mode - clock running at 40/16 MHz","FEB_v1::writeFifoInjectFE"); break;
325  }
326 
327  info("Injection FIFO 0","FEB_v1::writeFifoInjectFE");
328  for (int i=0; i<depth; ++i){
329  switch (pattern){
330  default: buffer[i]=(i+((i+1)<<12))&0xFFFF; break;
331  case 1: buffer[i]=(0)&0xFFFF; break;
332  case 2: buffer[i]=0xFFFF*(i&1); break;
333  case 10: buffer[i]=0x0FFF; break;
334  case 11: buffer[i]=0xF000; break;
335  case 12: buffer[i]=0; break;
336  case 13: buffer[i]=0; break;
337  case 20: i%4==0?buffer[i]=0x0FFF:buffer[i]=0; break;
338  case 21: i%4==0?buffer[i]=0xF000:buffer[i]=0; break;
339  case 22: buffer[i]=0; break;
340  case 23: buffer[i]=0; break;
341  case 30: i%4==0?buffer[i]=0x0AAA:buffer[i]=0; break;
342  case 31: i%4==0?buffer[i]=0xA000:buffer[i]=0; break;
343  case 32: buffer[i]=0; break;
344  case 33: buffer[i]=0; break;
345  case 40: buffer[i]=int(pow(2,i%12)); break;
346  case 41: buffer[i]=(int(pow(2,i%12))<<12)&0xFFFF; break;
347  case 42: buffer[i]=0; break;
348  case 43: buffer[i]=0; break;
349  case 50: buffer[i]=1; break;
350  case 51: buffer[i]=2; break;
351  case 52: buffer[i]=2048; break;
352  case 100: ((i>>4)&0x1)==0 ? buffer[i]=1 : buffer[i]=0; break;
353  }
354  }
355  for (int i=0; i<depth; ++i){
356  m_seqPga->spiWrite( m_fifoInjectAddress[0], buffer[i]);
357  }
358 
359  info("Injection FIFO 1","FEB_v1::writeFifoInjectFE");
360  for (int i=0; i<depth; ++i){
361  switch(pattern){
362  default: buffer[i]=((((i+1)>>4)&0xFF)+((i+2)<<8))&0xFFFF; break;
363  case 1: buffer[i]=(0)&0xFFFF; break;
364  case 2: buffer[i]=0xFFFF*(i&1); break;
365  case 10: buffer[i]=0; break;
366  case 11: buffer[i]=0x00FF; break;
367  case 12: buffer[i]=0xFF00; break;
368  case 13: buffer[i]=0; break;
369  case 20: buffer[i]=0; break;
370  case 21: i%4==0?buffer[i]=0x00FF:buffer[i]=0; break;
371  case 22: i%4==0?buffer[i]=0xFF00:buffer[i]=0; break;
372  case 23: buffer[i]=0; break;
373  case 30: buffer[i]=0; break;
374  case 31: i%4==0?buffer[i]=0x00AA:buffer[i]=0; break;
375  case 32: i%4==0?buffer[i]=0xAA00:buffer[i]=0; break;
376  case 33: buffer[i]=0; break;
377  case 40: buffer[i]=0; break;
378  case 41: buffer[i]=(int(pow(2,i%12))>>4)&0xFF; break;
379  case 42: buffer[i]=(int(pow(2,i%12))<<8)&0xFFFF; break;
380  case 43: buffer[i]=0; break;
381  case 50: buffer[i]=0; break;
382  case 51: buffer[i]=0; break;
383  case 52: buffer[i]=0; break;
384  case 100: buffer[i]=0; break;
385  }
386  }
387  for (int i=0; i<depth; ++i){
388  m_seqPga->spiWrite( m_fifoInjectAddress[1], buffer[i]);
389  }
390 
391  info("Injection FIFO 2","FEB_v1::writeFifoInjectFE");
392  for (int i=0; i<depth; ++i){
393  switch(pattern){
394  default: buffer[i]=((((i+2)>>8)&0xF)+((i+3)<<4))&0xFFFF; break;
395  case 1: buffer[i]=(0)&0xFFFF; break;
396  case 2: buffer[i]=0xFFFF*(i&1); break;
397  case 10: buffer[i]=0; break;
398  case 11: buffer[i]=0; break;
399  case 12: buffer[i]=0x000F; break;
400  case 13: buffer[i]=0xFFF0; break;
401  case 20: buffer[i]=0; break;
402  case 21: buffer[i]=0; break;
403  case 22: i%4==0?buffer[i]=0x000F:buffer[i]=0; break;
404  case 23: i%4==0?buffer[i]=0xFFF0:buffer[i]=0; break;
405  case 30: buffer[i]=0; break;
406  case 31: buffer[i]=0; break;
407  case 32: i%4==0?buffer[i]=0x000A:buffer[i]=0; break;
408  case 33: i%4==0?buffer[i]=0xAAA0:buffer[i]=0; break;
409  case 40: buffer[i]=0; break;
410  case 41: buffer[i]=0; break;
411  case 42: buffer[i]=(int(pow(2,i%12))>>8)&0xF; break;
412  case 43: buffer[i]=(int(pow(2,i%12))<<4)&0xFFFF; break;
413  case 50: buffer[i]=0; break;
414  case 51: buffer[i]=0; break;
415  case 52: buffer[i]=0; break;
416  case 100: buffer[i]=0; break;
417  }
418  }
419  for (int i=0; i<depth; ++i){
420  m_seqPga->spiWrite( m_fifoInjectAddress[2], buffer[i]);
421  }
422 }
423 //=============================================================================
424 //
425 //=============================================================================
426 void FEB_v1::writeDataFifoInjectFE( int fe, int *ch0, int* ch1, int* ch2, int* ch3){
428  int depth = testDuration(fe);
429 
430  info("Injection FIFO 0","FEB_v1::readFifoInjectFE");
431  for (int i=0; i<depth; ++i){m_fifo[0][i]=(ch0[i]&0xFFF)+((ch1[i]<<12)&0xF000);}
433  info("Injection FIFO 1","FEB_v1::readFifoInjectFE");
434  for (int i=0; i<depth; ++i){m_fifo[1][i]=((ch1[i]>>4)&0xFF)+((ch2[i]<<8)&0xFF00);}
436  info("Injection FIFO 2","FEB_v1::readFifoInjectFE");
437  for (int i=0; i<depth; ++i){m_fifo[2][i]=((ch2[i]>>8)&0xF)+((ch3[i]<<4)&0xFFF0);}
439 }
440 
441 //=============================================================================
442 //
443 //=============================================================================
445  warning("This function is commented.");
446  int depth = testDuration(fe);
447  /*
448  m_seqPga->setSpiAdd( m_feAddress[fe] );
449  m_seqPga -> setSpiSubAdd( m_fifoLLTAddress[0] );
450  info("LLT FE FIFO 0","FEB_v1::readFifoLLTFE");
451  for (int d=0; d<depth; ++d){
452  m_seqPga -> setSpiDataTx(d);
453  m_seqPga -> transmitSpi();
454  }
455  m_seqPga -> setSpiSubAdd( m_fifoLLTAddress[1] );
456  for (int d=0; d<depth; ++d){
457  m_seqPga -> setSpiDataTx(d);
458  m_seqPga -> transmitSpi();
459  }
460  m_seqPga -> setSpiSubAdd( m_fifoLLTAddress[2] );
461  for (int d=0; d<depth; ++d){
462  m_seqPga -> setSpiDataTx(d);
463  m_seqPga -> transmitSpi();
464  }
465 */
466 }
467 
468 //=============================================================================
469 //
470 //=============================================================================
473  StatusCode val = (m_seqPga->spiWrite(12,0));
474  debug("Reset FIFO Spy FE "+itos(fe),"FEB_v1::resetFifoSpyFE");
475  return val;
476 }
477 
478 //=============================================================================
479 //
480 //=============================================================================
483  StatusCode val = (m_seqPga->spiWrite(13,0));
484  info("Reset FIFO Inject FE "+itos(fe),"FEB_v1::resetFifoInjectFE");
485  return val;
486 }
487 
488 //=============================================================================
489 //
490 //=============================================================================
493  StatusCode val = (m_seqPga->spiWrite(11,0));
494  info("Reset FE "+itos(fe),"FEB_v1::resetFE");
495  return val;
496 }
497 
498 //=============================================================================
499 //
500 //=============================================================================
503  int val = (m_seqPga->spiRead(10));
504  info("Status register FE "+itos(fe)+": "+itos(val),"FEB_v1::statusRegister");
505  return val;
506 }
507 
508 //=============================================================================
509 //
510 //=============================================================================
513  int data = m_seqPga->spiRead(12);
514  data &= 0xFC00;
515  data |= (duration&0x3FF);
516  if (m_seqPga->spiWrite(12,data).isFailure()){
517  warning("Cannot write test sequence duration for Seq pga ","FEB_v1::setTestDuration");
518  return StatusCode::FAILURE;
519  }
520  for (int fe=0; fe<8; ++fe){
522  data = m_seqPga->spiRead(3);
523  data &= 0xFC00;
524  data |= (duration&0x3FF);
525  if (m_seqPga->spiWrite(3,data).isFailure()){
526  warning("Cannot write test sequence duration for FE pga "+ itos(fe),
527  "FEB_v1::setTestDuration");
528  return StatusCode::FAILURE;
529  }
530  }
531  return StatusCode::SUCCESS;
532 }
533 
534 //=============================================================================
535 //
536 //=============================================================================
537 int FEB_v1::testDuration(int fpga){
538  int val=-1;
539  if (fpga==-1){
541  val = (m_seqPga->spiRead(12))&0x3FF;
542  debug("Test Length Seq: "+itos(val),"FEB_v1::testDuration");
543  m_fifoDepth = val;
544  return val;
545  }
546  else {
548  val = (m_seqPga->spiRead(3))&0x3FF;
549  debug("Test Length FE: "+itos(fpga)+" "+itos(val),"FEB_v1::testDuration");
550  m_fifoDepth = val;
551  return val;
552  }
553 }
554 
555 //=============================================================================
556 //
557 //=============================================================================
560  int data = m_seqPga->spiRead(12);
561  data &= 0x0FFF;
562  data |= (stoploop<<12);
563  if (m_seqPga->spiWrite(12,data).isFailure()){
564  warning("Cannot write test sequence loop for Seq pga ","FEB_v1::setStopInjLoop");
565  return StatusCode::FAILURE;
566  }
567  for (int fe=0; fe<8; ++fe){
569  data = m_seqPga->spiRead(3);
570  data &= 0x0FFF;
571  data |= (stoploop<<12);
572  if (m_seqPga->spiWrite(3,data).isFailure()){
573  warning("Cannot write test loop for FE pga "+ itos(fe),
574  "FEB_v1::setStopInjLoop");
575  return StatusCode::FAILURE;
576  }
577  }
578  return StatusCode::SUCCESS;
579 }
580 
581 //=============================================================================
582 //
583 //=============================================================================
584 bool FEB_v1::stopInjLoop(int fpga){
585  bool val;
586  if (fpga==-1){
588  val = (m_seqPga->spiRead(12)>>12)&0x1;
589  info("Test Length Seq stop Loop: "+itos(val),"FEB_v1::stopInjLoop");
590  return val;
591  }
592  else {
594  val = (m_seqPga->spiRead(3)>>12)&0x1;
595  info("Test Length FE stop Loop : "+itos(fpga)+" "+itos(val),"FEB_v1::stopInjLoop");
596  return val;
597  }
598 }
599 
600 //=============================================================================
601 //
602 //=============================================================================
603 StatusCode FEB_v1::setProbeEnable( int fe, bool enable){
605  int val = m_seqPga->spiRead(2);
606  if (enable) {
607  info("Enabling Seq PGA probes","FEB_v1::setProbeEnable");
608  val |= 0xF;
609  }
610  else {
611  info("Disabling Seq PGA probes","FEB_v1::setProbeEnable");
612  val &=0xFFF0;
613  }
614  return m_seqPga->spiWrite(2,val);
615 }
616 
617 //=============================================================================
618 //
619 //=============================================================================
621  for (int fe = 0; fe<8; ++fe){
623  int val = (m_seqPga->spiRead(2))&0xF;
624  info("Probe Enable FE "+itos(fe)+": "+itos(val),"FEB_v1::probeEnable");
625  }
626 }
627 
628 //=============================================================================
629 //
630 //=============================================================================
633  int val = m_seqPga->spiRead(2) & 0xFF0F;
634  info("SetSpareForTrig FE "+itos(fe)+" : "+itos(enable),"FEB_v1::setSpareForTrigEnable");
635  val |= (enable<<4)&0xF0;
636  return m_seqPga->spiWrite(2,val);
637 }
638 
639 //=============================================================================
640 //
641 //=============================================================================
644  int val = ((m_seqPga->spiRead(2))&0xF0)>>4;
645  info("spareForTrigEnable for FE "+itos(fe)+" : "+itos(val),"FEB_v1::probeEnable");
646  return val;
647 }
648 
649 //=============================================================================
650 //
651 //=============================================================================
652 
655  unsigned int data=m_seqPga->spiRead(1);
656  if (value) data |= 32 ;
657  else data &= ~32 ;
658  return m_seqPga->spiWrite(1,data);
659 }
660 
663  int val = m_seqPga->spiRead(1)&&32 ;
664  info("Spy Mode Seq: "+itos(val),"FEB_v1::spyModeSeq");
665  return val;
666 }
667 
668 //=============================================================================
669 //
670 //=============================================================================
671 
672 StatusCode FEB_v1::setSpyModeFE( int fe, bool value ){
674  unsigned int data=m_seqPga->spiRead(1);
675  if (value) data |= 1 << 14 ;
676  else data &= ~(1<<14) ;
677  if (m_seqPga->spiWrite(1,data).isFailure()){
678  return StatusCode::FAILURE;
679  }
680  info("set Spy Mode FE "+itos(fe)+" : "+itos(value)+" setup0="+itos(data),"FEB_v1::spyModeFE");
681  return StatusCode::SUCCESS;
682 }
683 
684 bool FEB_v1::spyModeFE( int fe ){
686  int val = (m_seqPga->spiRead(1)>>14)&1;
687  info("Spy Mode FE "+itos(fe)+": "+itos(val),"FEB_v1::spyModeFE");
688  return val;
689 }
690 
691 //=============================================================================
692 //
693 //=============================================================================
694 
695 StatusCode FEB_v1::setThreshold( int fe, int value ){
697  unsigned int data=m_seqPga->spiRead(1);
698  data = data & 0xc7FF;
699  data += (value<<11);
700 
701  if (m_seqPga->spiWrite(1,data).isFailure()){
702  return StatusCode::FAILURE;
703  }
704  info("set Threshold "+itos(fe)+": "+itos(value),"FEB_v1::setThreshold");
705  return StatusCode::SUCCESS;
706 }
707 
708 int FEB_v1::threshold( int fe ){
710  int val = (m_seqPga->spiRead(1)>>11)&7;
711  info("threshold FE"+itos(fe)+": "+itos(val),"FEB_v1::threshold");
712  return val;
713 }
714 
715 //=============================================================================
716 //
717 //=============================================================================
718 
719 StatusCode FEB_v1::setLatency( int fe, int value ){
721  unsigned int data=m_seqPga->spiRead(1);
722  data = data & 0xFF00;
723  data += value&0xFF;
724  if (m_seqPga->spiWrite(1,data).isFailure()){
725  return StatusCode::FAILURE;
726  }
727  info("set Latency "+itos(fe)+": "+itos(value),"FEB_v1::setLatency");
728  return StatusCode::SUCCESS;
729 }
730 
731 int FEB_v1::latency( int fe ){
733  int val = (m_seqPga->spiRead(1))&(0xFF);
734  info("latency FE "+itos(fe)+": "+itos(val),"FEB_v1::latency");
735  return val;
736 }
737 
738 //=============================================================================
739 //
740 //=============================================================================
741 
744  unsigned int data=m_seqPga->spiRead(1);
745  data = data & 0xFDFF;
746  data += (value<<9);
747  if (m_seqPga->spiWrite(1,data).isFailure()){
748  return StatusCode::FAILURE;
749  }
750  info("set Disable Subtraction "+itos(fe)+": "+itos(value),"FEB_v1::setDisableSubtract");
751  return StatusCode::SUCCESS;
752 }
753 
754 bool FEB_v1::disableSubtract( int fe ){
756  int val = (m_seqPga->spiRead(1)>>9)&1;
757  info("Disable Subtraction FE "+itos(fe)+": "+itos(val),"FEB_v1::disableSubtract");
758  return val;
759 }
760 
761 //=============================================================================
762 //
763 //=============================================================================
764 
767  unsigned int data=m_seqPga->spiRead(1);
768  if (value) data |= 2048 ;
769  else data &= ~2048 ;
770  return m_seqPga->spiWrite(1,data);
771 }
772 
775  int data=m_seqPga->spiRead(1);
776  return ( data >>11 ) & 1;
777 }
778 
779 //=============================================================================
780 //
781 //=============================================================================
782 
783 StatusCode FEB_v1::setOldSubtract( int fe, bool value ){
785  unsigned int data=m_seqPga->spiRead(1);
786  data = data & 0xFEFF;
787  data += (value<<8);
788  if (m_seqPga->spiWrite(1,data).isFailure()){
789  return StatusCode::FAILURE;
790  }
791  info("set Old Subtraction mode "+itos(fe)+": "+itos(value),"FEB_v1::setOldSubtract");
792  return StatusCode::SUCCESS;
793 }
794 
795 bool FEB_v1::oldSubtract( int fe ){
797  int val = (m_seqPga->spiRead(1)>>8)&1;
798  info("Old Subtract "+itos(fe)+": "+itos(val),"FEB_v1::oldSubtract");
799  return val;
800 }
801 
802 //=============================================================================
803 //
804 //=============================================================================
805 
806 StatusCode FEB_v1::setInjectModeFE( int fe, bool value ){
808  unsigned int data=m_seqPga->spiRead(1);
809  if (value) data |= 1 << 10 ;
810  else data &= ~(1<<10) ;
811  if (m_seqPga->spiWrite(1,data).isFailure()){
812  return StatusCode::FAILURE;
813  }
814  info("set Inject Mode FE "+itos(fe)+": "+itos(value),"FEB_v1::injectModeFE");
815  return StatusCode::SUCCESS;
816 }
817 
818 bool FEB_v1::injectModeFE( int fe ){
820  int val = (m_seqPga->spiRead(1)>>10)&1;
821  info("Inject Mode FE "+itos(fe)+": "+itos(val),"FEB_v1::injectModeFE");
822  return (bool)(val);
823 }
824 
825 //=============================================================================
826 //
827 //=============================================================================
828 
829 StatusCode FEB_v1::setGain4( int fe, int ch, bool value ){
830  if (ch>3){
831  warning("try to configure a channel that does not exist.","FEB_v1::setGain4");
832  return StatusCode::FAILURE;
833  }
835  unsigned int data=m_seqPga->spiRead(4+ch);
836  if (value) data |= 1 << 11 ;
837  else data &= ~(1<<11) ;
838  if (m_seqPga->spiWrite(4+ch,data).isFailure()){
839  return StatusCode::FAILURE;
840  }
841  info("set Gain4 FE "+itos(fe)+" - Ch "+itos(ch)+" : "+itos(value),"FEB_v1::setGain4");
842  return StatusCode::SUCCESS;
843 }
844 
845 bool FEB_v1::gain4( int fe , int ch ){
847  int val = (m_seqPga->spiRead(4+ch)>>11)&1;
848  info("Gain4 FE "+itos(fe)+" - Ch "+itos(ch)+" : "+itos(val),"FEB_v1::gain4");
849  return (bool)(val);
850 }
851 
852 //=============================================================================
853 //
854 //=============================================================================
855 
856 StatusCode FEB_v1::setPseudoADCEnable( int fe, int ch, bool value ){
857  if (ch>3){
858  warning("try to configure a channel that does not exist.","FEB_v1::setPseudoADCEnable");
859  return StatusCode::FAILURE;
860  }
862  unsigned int data=m_seqPga->spiRead(4+ch);
863  if (value) data |= 1 << 10 ;
864  else data &= ~(1<<10) ;
865  if (m_seqPga->spiWrite(4+ch,data).isFailure()){
866  return StatusCode::FAILURE;
867  }
868  info("set PseudoADCEnable "+itos(fe)+" - Ch "+itos(ch)+" : "+itos(value),"FEB_v1::setPseudoADCEnable");
869  return StatusCode::SUCCESS;
870 }
871 
872 bool FEB_v1::pseudoADCEnable( int fe , int ch ){
874  int val = (m_seqPga->spiRead(4+ch)>>10)&1;
875  info("Pseudo ADC Enable FE "+itos(fe)+" - Ch "+itos(ch)+" : "+itos(val),"FEB_v1::pseudoADCEnable");
876  return (bool)(val);
877 }
878 
879 //=============================================================================
880 //
881 //=============================================================================
882 
883 StatusCode FEB_v1::setPseudoPMEnable( int fe, int ch, bool value ){
884  if (ch>3){
885  warning("try to configure a channel that does not exist.","FEB_v1::setPseudoPMEnable");
886  return StatusCode::FAILURE;
887  }
889  unsigned int data=m_seqPga->spiRead(4+ch);
890  if (value) data |= 1 << 9 ;
891  else data &= ~(1<<9) ;
892  if (m_seqPga->spiWrite(4+ch,data).isFailure()){
893  return StatusCode::FAILURE;
894  }
895  info("set PseudoPMEnable FE "+itos(fe)+" - Ch "+itos(ch)+" : "+itos(value),"FEB_v1::setPseudoPMEnable");
896  return StatusCode::SUCCESS;
897 }
898 
899 bool FEB_v1::pseudoPMEnable( int fe , int ch ){
901  int val = (m_seqPga->spiRead(4+ch)>>9)&1;
902  info("Pseudo PM Enable FE "+itos(fe)+" - Ch "+itos(ch)+" : "+itos(val),"FEB_v1::pseudoPMEnable");
903  return (bool)(val);
904 }
905 
906 //=============================================================================
907 //
908 //=============================================================================
909 
912  unsigned int data=m_seqPga->spiRead(1);
913  if (value) data |= 1 << 10 ;
914  else data &= ~(1<<10) ;
915  if (m_seqPga->spiWrite(1,data).isFailure()){
916  return StatusCode::FAILURE;
917  }
918  info("set GlobalPseudoPMEnable FE "+itos(fe)+" : "+itos(value),"FEB_v1::setGlobalPseudoPMEnable");
919  return StatusCode::SUCCESS;
920 }
921 
924  int val = (m_seqPga->spiRead(1)>>10)&1;
925  info("Global Pseudo PM Enable FE "+itos(fe)+" : "+itos(val),"FEB_v1::globalPseudoPMEnable");
926  return (bool)(val);
927 }
928 
929 //=============================================================================
930 //
931 //=============================================================================
932 
933 StatusCode FEB_v1::setClockFallingEdge( int fe, int ch, bool value ){
934  if (ch>3){
935  warning("try to configure a channel that does not exist.","FEB_v1::setClockFallingEdge");
936  return StatusCode::FAILURE;
937  }
939  unsigned int data=m_seqPga->spiRead(4+ch);
940  if (value) data |= 1 << 8 ;
941  else data &= ~(1<<8) ;
942  if (m_seqPga->spiWrite(4+ch,data).isFailure()){
943  return StatusCode::FAILURE;
944  }
945  info("set Clock Falling Edge FPGA "+itos(fe)+" - Ch "+itos(ch)+" : "+itos(value),"FEB_v1::setClockFallingEdge");
946  return StatusCode::SUCCESS;
947 }
948 
949 bool FEB_v1::clockFallingEdge( int fe , int ch ){
951  int val = (m_seqPga->spiRead(4+ch)>>8)&1;
952  info("clock Falling Edge FE "+itos(fe)+" - Ch "+itos(ch)+" : "+itos(val),"FEB_v1::clockFallingEdge");
953  return (bool)(val);
954 }
955 //=============================================================================
956 //
957 //=============================================================================
958 
961  unsigned int data=m_seqPga->spiRead(1);
962  data &= 0xFFEF;
963  data |= (value<<4) & 0x10;
964  if (m_seqPga->spiWrite(1,data).isFailure()){
965  return StatusCode::FAILURE;
966  }
967  info("set Clock 80MHz Falling Edge : "+itos(value),"FEB_v1::setClock80MzFallingEdge");
968  return StatusCode::SUCCESS;
969 }
970 
973  int val = (m_seqPga->spiRead(1)>>4)&1;
974  info("clock 80MHz Falling Edge : "+itos(val),"FEB_v1::clock80MHzFallingEdge");
975  return (bool)(val);
976 }
977 
978 //=============================================================================
979 //
980 //=============================================================================
981 
982 StatusCode FEB_v1::setCalibCte( int fe, int ch, int value ){
983  if (ch>3){
984  warning("try to configure a channel that does not exist.","FEB_v1::setClockFallingEdge");
985  return StatusCode::FAILURE;
986  }
988  unsigned int data=m_seqPga->spiRead(4+ch);
989  data = data & (0xFF00);
990  data += value;
991  if (m_seqPga->spiWrite(4+ch,data).isFailure()){
992  return StatusCode::FAILURE;
993  }
994  info("set Calibration constant "+itos(fe)+" - Ch "+itos(fe)+" : "+itos(value),"FEB_v1::setCalibCte");
995  return StatusCode::SUCCESS;
996 }
997 
998 int FEB_v1::calibCte( int fe , int ch ){
1000  int val = (m_seqPga->spiRead(4+ch))&0xFF;
1001  info("Calib Constante FE "+itos(fe)+" - Ch "+itos(ch)+" : "+itos(val),"FEB_v1::calibCte");
1002  return (bool)(val);
1003 }
1004 
1005 //=============================================================================
1006 //
1007 //=============================================================================
1008 
1011  int latency = m_seqPga->spiRead(3);
1012  m_latency0=(latency>>12)&0xF;
1013  m_latency1=(latency>>8)&0xF;
1014  m_latency2=(latency>>4)&0xF;
1015  m_latency3=latency&0xF;
1016  info("LLT Channel latency : "+itos(m_latency0));
1017  info("LLT Up nb latency : "+itos(m_latency1));
1018  info("LLT Side nb latency : "+itos(m_latency2));
1019  info("LLT Corner latency : "+itos(m_latency3));
1020 }
1021 
1022 //=============================================================================
1023 //
1024 //=============================================================================
1025 
1028  int latency = m_seqPga->spiRead(3);
1029  latency &=0xFFF;
1030  latency |=((val&0xF)<<12);
1031  if (m_seqPga->spiWrite(3,latency).isFailure()){
1032  return StatusCode::FAILURE;
1033  }
1034  m_latency0=val;
1035  return StatusCode::SUCCESS;
1036 }
1037 
1038 //=============================================================================
1039 //
1040 //=============================================================================
1041 
1044  int latency = m_seqPga->spiRead(3);
1045  latency &=0xF0FF;
1046  latency |=((val&0xF)<<8);
1047  if (m_seqPga->spiWrite(3,latency).isFailure()){
1048  return StatusCode::FAILURE;
1049  }
1050  m_latency1=val;
1051  return StatusCode::SUCCESS;
1052 }
1053 
1054 //=============================================================================
1055 //
1056 //=============================================================================
1057 
1060  int latency = m_seqPga->spiRead(3);
1061  latency &=0xFF0F;
1062  latency |=((val&0xF)<<4);
1063  if (m_seqPga->spiWrite(3,latency).isFailure()){
1064  return StatusCode::FAILURE;
1065  }
1066  m_latency2=val;
1067  return StatusCode::SUCCESS;
1068 }
1069 
1070 //=============================================================================
1071 //
1072 //=============================================================================
1073 
1076  int latency = m_seqPga->spiRead(3);
1077  latency &=0xFFF0;
1078  latency |=val&0xF;
1079  if (m_seqPga->spiWrite(3,latency).isFailure()){
1080  return StatusCode::FAILURE;
1081  }
1082  m_latency3=val;
1083  return StatusCode::SUCCESS;
1084 }
1085 
1086 
1087 //=============================================================================
1088 //
1089 //=============================================================================
1090 
1093  m_mask0=m_seqPga->spiRead(4);
1094  m_mask1=m_seqPga->spiRead(5);
1095  m_mask2=m_seqPga->spiRead(6);
1096  for (int i = 0; i<16; ++i){
1097  info("Channel "+itos(i)+" masked status : "+itos((m_mask0>>i)&1));
1098  }
1099  for (int i = 0; i<16; ++i){
1100  info("Channel "+itos(i+16)+" masked status : "+itos((m_mask1>>i)&1));
1101  }
1102  for (int i = 0; i<4; ++i){
1103  info("Up Neig "+itos(i)+" masked status : "+itos((m_mask2>>(i+12))&1));
1104  }
1105  for (int i = 0; i<8; ++i){
1106  info("Sd Neig "+itos(i)+" masked status : "+itos((m_mask2>>(i+4))&1));
1107  }
1108  info("Corner masked status : "+itos((m_mask2>>3)&1));
1109 }
1110 
1111 //=============================================================================
1112 //
1113 //=============================================================================
1114 
1115 StatusCode FEB_v1::setMaskLLT(int ch, bool val){
1117  if (ch<16) {
1118  m_mask0=m_seqPga->spiRead(4);
1119  if (val) m_mask0 |= 1 << ch ;
1120  else m_mask0 &= ~(1<<ch) ;
1121  if (m_seqPga->spiWrite(4,m_mask0).isFailure()){
1122  return StatusCode::FAILURE;
1123  }
1124  return StatusCode::SUCCESS;
1125  }
1126  else if (ch<32) {
1127  m_mask1=m_seqPga->spiRead(5);
1128  if (val) m_mask1 |= 1 << (ch-16) ;
1129  else m_mask1 &= ~(1<<(ch-16)) ;
1130  if (m_seqPga->spiWrite(5,m_mask1).isFailure()){
1131  return StatusCode::FAILURE;
1132  }
1133  return StatusCode::SUCCESS;
1134  }
1135  return StatusCode::FAILURE;
1136 }
1137 
1138 //=============================================================================
1139 //
1140 //=============================================================================
1143  m_mask2=m_seqPga->spiRead(6);
1144  if (val) m_mask2 |= (1 << 3) ;
1145  else m_mask2 &= ~(1<<3) ;
1146  if (m_seqPga->spiWrite(6,m_mask2).isFailure()){
1147  return StatusCode::FAILURE;
1148  }
1149  return StatusCode::SUCCESS;
1150 }
1151 
1152 //=============================================================================
1153 //
1154 //=============================================================================
1157  m_mask2=m_seqPga->spiRead(6);
1158  if (val) m_mask2 |= (1 << (12+ch)) ;
1159  else m_mask2 &= ~(1<< (12+ch)) ;
1160  if (m_seqPga->spiWrite(6,m_mask2).isFailure()){
1161  return StatusCode::FAILURE;
1162  }
1163  return StatusCode::SUCCESS;
1164 }
1165 
1166 //=============================================================================
1167 //
1168 //=============================================================================
1171  m_mask2=m_seqPga->spiRead(6);
1172  if (val) m_mask2 |= (1 << (4+ch)) ;
1173  else m_mask2 &= ~(1<< (4+ch)) ;
1174  if (m_seqPga->spiWrite(6,m_mask2).isFailure()){
1175  return StatusCode::FAILURE;
1176  }
1177  return StatusCode::SUCCESS;
1178 }
1179 
1180 //=============================================================================
1181 //
1182 //=============================================================================
1183 
1184 StatusCode FEB_v1::setGbtMode(int gbt, int mode ){
1185  std::string modes[4] = {
1186  "Normal operating mode",
1187  "Fixed pattern mode",
1188  "30 bit counter",
1189  "7 bit shift register"
1190  };
1192  if (m_seqPga->i2cWrite(28, mode).isFailure()){
1193  warning("Cannot set Tx mode of the GBT "+itos(gbt)+
1194  " to "+modes[mode]+" ["+itos(mode)+"]");
1195  return StatusCode::FAILURE;
1196  }
1197  info("Setting Tx mode of the GBT "+itos(gbt)+
1198  " to "+modes[mode]+" ["+itos(mode)+"]");
1199  return StatusCode::SUCCESS;
1200 }
1201 
1202 int FEB_v1::gbtMode( int gbt ){
1203  std::string modes[4] = {
1204  "Normal operating mode",
1205  "Fixed pattern mode",
1206  "30 bit counter",
1207  "7 bit shift register"
1208  };
1210  int mode = m_seqPga->i2cRead(28);
1211  info("Tx mode of the GBT "+itos(gbt)+
1212  " is : "+modes[mode]+" ["+itos(mode)+"]");
1213  return mode;
1214 }
1215 
1216 //=============================================================================
1217 //
1218 //=============================================================================
1219 
1220 StatusCode FEB_v1::setGbtDataPath(int gbt, int tx0, int tx1, int tx2){
1222  int wd = (tx2<<4)+(tx1<<2)+tx0;
1223  if (m_seqPga->i2cWrite(29, wd).isFailure()){
1224  warning("Cannot set data path (A) of the GBT "+itos(gbt));
1225  return StatusCode::FAILURE;
1226  }
1227  if (m_seqPga->i2cWrite(30, wd).isFailure()){
1228  warning("Cannot set data path (B) of the GBT "+itos(gbt));
1229  return StatusCode::FAILURE;
1230  }
1231  if (m_seqPga->i2cWrite(31, wd).isFailure()){
1232  warning("Cannot set data path (C) of the GBT "+itos(gbt));
1233  return StatusCode::FAILURE;
1234  }
1235  info("Setting data path of the GBT "+itos(gbt)+" to "+itos(wd));
1236  return StatusCode::SUCCESS;
1237 }
1238 
1239 int FEB_v1::gbtDataPath( int gbt ){
1241  int mode = m_seqPga->i2cRead(29);
1242  info("Data Path (A) of the GBT "+itos(gbt)+" is "+itos(mode));
1243  info("Data Path (B) of the GBT "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(30)));
1244  info("Data Path (C) of the GBT "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(31)));
1245  return mode;
1246 }
1247 
1248 //=============================================================================
1249 //
1250 //=============================================================================
1251 
1253  std::string str_mode[3]={
1254  "Static phase selection",
1255  "Training mode",
1256  "Automatic phase tracking"
1257  };
1259  int wd = (mode<<4)+(mode<<2)+mode;
1260  if (m_seqPga->i2cWrite(62, wd).isFailure()){
1261  warning("Cannot set GBT track mode of the GBT "+itos(gbt));
1262  return StatusCode::FAILURE;
1263  }
1264  info("Setting track mode of the GBT "+itos(gbt)+" to "+itos(wd)+" -> "+str_mode[mode&0b11]);
1265  return StatusCode::SUCCESS;
1266 }
1267 
1268 int FEB_v1::gbtTrackMode( int gbt ){
1269  std::string str_mode[3]={
1270  "Static phase selection",
1271  "Training mode",
1272  "Automatic phase tracking"
1273  };
1275  int mode = m_seqPga->i2cRead(62);
1276  info("Track mode of the GBT "+itos(gbt)+" is : "+itos(mode)+" -> "+str_mode[mode&0b11]);
1277  return mode;
1278 }
1279 
1280 //=============================================================================
1281 //
1282 //=============================================================================
1283 
1286  int wd = 0xff;
1287  if (!term){
1288  wd = 0;
1289  }
1290  if (m_seqPga->i2cWrite(320, wd).isFailure()){
1291  warning("Cannot set GBT Term Eport 320 of the GBT "+itos(gbt));
1292  return StatusCode::FAILURE;
1293  }
1294  if (m_seqPga->i2cWrite(321, wd).isFailure()){
1295  warning("Cannot set GBT Term Eport 320 of the GBT "+itos(gbt));
1296  return StatusCode::FAILURE;
1297  }
1298  if (m_seqPga->i2cWrite(322, wd).isFailure()){
1299  warning("Cannot set GBT Term Eport 320 of the GBT "+itos(gbt));
1300  return StatusCode::FAILURE;
1301  }
1302  if (m_seqPga->i2cWrite(323, wd).isFailure()){
1303  warning("Cannot set GBT Term Eport 320 of the GBT "+itos(gbt));
1304  return StatusCode::FAILURE;
1305  }
1306  if (m_seqPga->i2cWrite(324, wd).isFailure()){
1307  warning("Cannot set GBT Term Eport 320 of the GBT "+itos(gbt));
1308  return StatusCode::FAILURE;
1309  }
1310  if (m_seqPga->i2cWrite(325, wd).isFailure()){
1311  warning("Cannot set GBT Term Eport 320 of the GBT "+itos(gbt));
1312  return StatusCode::FAILURE;
1313  }
1314  if (m_seqPga->i2cWrite(326, wd).isFailure()){
1315  warning("Cannot set GBT Term Eport 320 of the GBT "+itos(gbt));
1316  return StatusCode::FAILURE;
1317  }
1318  info("Setting Eport Termination of the GBT "+itos(gbt)+" to "+itos(wd&1));
1319  return StatusCode::SUCCESS;
1320 }
1321 
1322 bool FEB_v1::gbtTermEport( int gbt ){
1324  info("Eport termination of the GBT (320) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(320)&1));
1325  info("Eport termination of the GBT (321) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(321)&1));
1326  info("Eport termination of the GBT (322) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(322)&1));
1327  info("Eport termination of the GBT (323) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(323)&1));
1328  info("Eport termination of the GBT (324) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(324)&1));
1329  info("Eport termination of the GBT (325) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(325)&1));
1330  info("Eport termination of the GBT (326) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(326)&1));
1331  return m_seqPga->i2cRead(320)&1;
1332 }
1333 
1334 //=============================================================================
1335 //
1336 //=============================================================================
1337 
1340  int wd = (1<<4)+(1<<2)+1;
1341  if (m_seqPga->i2cWrite(63, wd).isFailure()){
1342  warning("Cannot set GBT Eport clock at 80MHz for GBT "+itos(gbt));
1343  return StatusCode::FAILURE;
1344  }
1345  if (m_seqPga->i2cWrite(87, wd).isFailure()){
1346  warning("Cannot set GBT Eport clock at 80MHz for GBT "+itos(gbt));
1347  return StatusCode::FAILURE;
1348  }
1349  if (m_seqPga->i2cWrite(111, wd).isFailure()){
1350  warning("Cannot set GBT Eport clock at 80MHz for GBT "+itos(gbt));
1351  return StatusCode::FAILURE;
1352  }
1353  if (m_seqPga->i2cWrite(135, wd).isFailure()){
1354  warning("Cannot set GBT Eport clock at 80MHz for GBT "+itos(gbt));
1355  return StatusCode::FAILURE;
1356  }
1357  if (m_seqPga->i2cWrite(159, wd).isFailure()){
1358  warning("Cannot set GBT Eport clock at 80MHz for GBT "+itos(gbt));
1359  return StatusCode::FAILURE;
1360  }
1361  if (m_seqPga->i2cWrite(183, wd).isFailure()){
1362  warning("Cannot set GBT Eport clock at 80MHz for GBT "+itos(gbt));
1363  return StatusCode::FAILURE;
1364  }
1365  if (m_seqPga->i2cWrite(207, wd).isFailure()){
1366  warning("Cannot set GBT Eport clock at 80MHz for GBT "+itos(gbt));
1367  return StatusCode::FAILURE;
1368  }
1369  info("Setting Eport clock at 80MHz for the GBT "+itos(gbt));
1370  return StatusCode::SUCCESS;
1371 }
1372 
1375  int mode = m_seqPga->i2cRead(63);
1376  info("Eport clock for the GBT (63) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(63)));
1377  info("Eport clock for the GBT (87) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(87)));
1378  info("Eport clock for the GBT (111) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(111)));
1379  info("Eport clock for the GBT (135) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(135)));
1380  info("Eport clock for the GBT (159) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(159)));
1381  info("Eport clock for the GBT (183) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(183)));
1382  info("Eport clock for the GBT (207) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(207)));
1383  return mode;
1384 }
1385 
1386 //=============================================================================
1387 //
1388 //=============================================================================
1389 
1392  int wd1 = 0b1011;
1393  int wd0 = (wd1<<4)+wd1;
1394  if (m_seqPga->i2cWrite(64, wd0).isFailure()){
1395  warning("Cannot set DLL charge pump (64) for GBT "+itos(gbt));
1396  return StatusCode::FAILURE;
1397  }
1398  if (m_seqPga->i2cWrite(65, wd1).isFailure()){
1399  warning("Cannot set DLL charge pump (65) for GBT "+itos(gbt));
1400  return StatusCode::FAILURE;
1401  }
1402  if (m_seqPga->i2cWrite(88, wd0).isFailure()){
1403  warning("Cannot set DLL charge pump (88) for GBT "+itos(gbt));
1404  return StatusCode::FAILURE;
1405  }
1406  if (m_seqPga->i2cWrite(89, wd1).isFailure()){
1407  warning("Cannot set DLL charge pump (89) for GBT "+itos(gbt));
1408  return StatusCode::FAILURE;
1409  }
1410  if (m_seqPga->i2cWrite(112, wd0).isFailure()){
1411  warning("Cannot set DLL charge pump (112) for GBT "+itos(gbt));
1412  return StatusCode::FAILURE;
1413  }
1414  if (m_seqPga->i2cWrite(113, wd1).isFailure()){
1415  warning("Cannot set DLL charge pump (113) for GBT "+itos(gbt));
1416  return StatusCode::FAILURE;
1417  }
1418  if (m_seqPga->i2cWrite(136, wd0).isFailure()){
1419  warning("Cannot set DLL charge pump (136) for GBT "+itos(gbt));
1420  return StatusCode::FAILURE;
1421  }
1422  if (m_seqPga->i2cWrite(137, wd1).isFailure()){
1423  warning("Cannot set DLL charge pump (137) for GBT "+itos(gbt));
1424  return StatusCode::FAILURE;
1425  }
1426  if (m_seqPga->i2cWrite(160, wd0).isFailure()){
1427  warning("Cannot set DLL charge pump (160) for GBT "+itos(gbt));
1428  return StatusCode::FAILURE;
1429  }
1430  if (m_seqPga->i2cWrite(161, wd1).isFailure()){
1431  warning("Cannot set DLL charge pump (161) for GBT "+itos(gbt));
1432  return StatusCode::FAILURE;
1433  }
1434  if (m_seqPga->i2cWrite(184, wd0).isFailure()){
1435  warning("Cannot set DLL charge pump (184) for GBT "+itos(gbt));
1436  return StatusCode::FAILURE;
1437  }
1438  if (m_seqPga->i2cWrite(185, wd1).isFailure()){
1439  warning("Cannot set DLL charge pump (185) for GBT "+itos(gbt));
1440  return StatusCode::FAILURE;
1441  }
1442  if (m_seqPga->i2cWrite(208, wd0).isFailure()){
1443  warning("Cannot set DLL charge pump (208) for GBT "+itos(gbt));
1444  return StatusCode::FAILURE;
1445  }
1446  if (m_seqPga->i2cWrite(209, wd1).isFailure()){
1447  warning("Cannot set DLL charge pump (209) for GBT "+itos(gbt));
1448  return StatusCode::FAILURE;
1449  }
1450  if (m_seqPga->i2cWrite(231, wd0).isFailure()){
1451  warning("Cannot set DLL charge pump (231) for GBT "+itos(gbt));
1452  return StatusCode::FAILURE;
1453  }
1454  if (m_seqPga->i2cWrite(232, wd1).isFailure()){
1455  warning("Cannot set DLL charge pump (232) for GBT "+itos(gbt));
1456  return StatusCode::FAILURE;
1457  }
1458  if (m_seqPga->i2cWrite(233, 7).isFailure()){
1459  warning("Cannot set DLL charge pump (232) for GBT "+itos(gbt));
1460  return StatusCode::FAILURE;
1461  }
1462  info("Setting DLL Eport for the GBT "+itos(gbt));
1463  info("Setting Phase aligner lock detection mode for GBT "+itos(gbt));
1464  return StatusCode::SUCCESS;
1465 }
1466 
1467 void FEB_v1::gbtDLLEport( int gbt ){
1469  info("Eport DLL Charge pump for the GBT (64) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(64)));
1470  info("Eport DLL Charge pump for the GBT (65) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(65)));
1471  info("Eport DLL Charge pump for the GBT (88) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(88)));
1472  info("Eport DLL Charge pump for the GBT (89) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(89)));
1473  info("Eport DLL Charge pump for the GBT (112) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(112)));
1474  info("Eport DLL Charge pump for the GBT (113) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(113)));
1475  info("Eport DLL Charge pump for the GBT (136) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(136)));
1476  info("Eport DLL Charge pump for the GBT (137) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(137)));
1477  info("Eport DLL Charge pump for the GBT (160) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(160)));
1478  info("Eport DLL Charge pump for the GBT (161) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(161)));
1479  info("Eport DLL Charge pump for the GBT (184) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(184)));
1480  info("Eport DLL Charge pump for the GBT (185) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(185)));
1481  info("Eport DLL Charge pump for the GBT (208) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(208)));
1482  info("Eport DLL Charge pump for the GBT (209) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(209)));
1483  info("Eport DLL Charge pump for the GBT (231) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(231)));
1484  info("Eport DLL Charge pump for the GBT (232) "+itos(gbt)+" is "+itos(m_seqPga->i2cRead(232)));
1485 }
1486 
1487 //=============================================================================
1488 //
1489 //=============================================================================
1490 
1493  int wd = 0xff;
1494  if (!enable){
1495  wd = 0;
1496  }
1497  int ports[21]={81, 82, 83, 105, 106, 107, 129, 130, 131, 153, 154,
1498  155, 177, 178, 179, 201, 202, 203, 225, 226, 227};
1499  for (int i=0; i<21; ++i){
1500  if (m_seqPga->i2cWrite(ports[i], wd).isFailure()){
1501  warning("Cannot set (en)able eport ("+itos(ports[i])+") of GBT "+itos(gbt));
1502  return StatusCode::FAILURE;
1503  }
1504  };
1505  if (enable){
1506  info("Enabling Eports for the GBT "+itos(gbt));
1507  }
1508  else
1509  {
1510  info("Disabling Eports for the GBT "+itos(gbt));
1511  }
1512  return StatusCode::SUCCESS;
1513 }
1514 
1515 bool FEB_v1::gbtEnableEport( int gbt ){
1516  int ports[21]={81, 82, 83, 105, 106, 107, 129, 130, 131, 153, 154,
1517  155, 177, 178, 179, 201, 202, 203, 225, 226, 227};
1519  for (int i = 0; i<21; ++i){
1520  info("Eport enable ("+itos(ports[i])+") for the GBT "+itos(gbt)+" : "+itos(m_seqPga->i2cRead(ports[i])));
1521  }
1522  return m_seqPga->i2cRead(ports[0])&1;
1523 }
1524 //=============================================================================
1525 //
1526 //=============================================================================
1527 
1529  info("Setting the gbt "+itos(gbt)+" output clock strength to "+itos(strength));
1531  int wd = ((strength&0xF)<<4)+(strength&0xF);
1532  int ports[4]={ 269, 270, 271, 272 };
1533  for (int i=0; i<4; ++i){
1534  if (m_seqPga->i2cWrite(ports[i], wd).isFailure()){
1535  warning("Cannot set gbt output clock strength ("+itos(ports[i])+") of GBT "+itos(gbt));
1536  return StatusCode::FAILURE;
1537  }
1538  };
1539  return StatusCode::SUCCESS;
1540 }
1541 
1543  int ports[4]={ 269, 270, 271, 272 };
1545  int val0 = m_seqPga->i2cRead(ports[0])&0xF;
1546  int val1 = m_seqPga->i2cRead(ports[1])&0xF;
1547  int val2 = m_seqPga->i2cRead(ports[2])&0xF;
1548  int val3 = m_seqPga->i2cRead(ports[3])&0xF;
1549  if ( val1 != val0 || val2 != val0 || val3 != val0 ){
1550  warning("Output clock strength registers are not identical");
1551  return -1;
1552  }
1553  if ( (val0&0xF) != ((val0&0xF0)>>4)){
1554  warning("Output clock strength registers are not identical");
1555  return -1;
1556  }
1557  return val0&0xF;
1558 }
1559 
1560 //=============================================================================
1561 //
1562 //=============================================================================
1563 
1564 StatusCode FEB_v1::setOutputEport(int gbt, int latency, int clock){
1566  unsigned int data=(clock&0xFF)+((latency&0xFF)<<8);
1567  if (m_seqPga->spiWrite(20+gbt,data).isFailure()){
1568  warning("Cannot set Output EPort phase FPGA Seq - GBT "+itos(gbt)+" : "+itos(data),"FEB_v1::setOutputEPort");
1569  return StatusCode::FAILURE;
1570  }
1571  info("set Output EPort phase FPGA Seq - GBT "+itos(gbt)+" : "+itos(data),"FEB_v1::setOutputEPort");
1572  return StatusCode::SUCCESS;
1573 }
1574 
1577  return ((m_seqPga->spiRead(20+gbt)>>8)&0xFF);
1578 }
1579 
1580 int FEB_v1::latencyEport (int gbt){
1582  return (m_seqPga->spiRead(20+gbt)&0xFF);
1583 }
1584 
1585 //=============================================================================
1586 //
1587 //=============================================================================
1588 
1589 StatusCode FEB_v1::setOutputEport(int fe, int ch, int latency, int clock){
1591  unsigned int data=(clock&0x3F)+((latency&0x3F)<<6);
1592  if (m_seqPga->spiWrite(14+ch,data).isFailure()){
1593  warning("Cannot set Output EPort phase FPGA"+itos(fe)+" - Ch "+itos(ch)+" : "+itos(data),"FEB_v1::setOutputEPort");
1594  return StatusCode::FAILURE;
1595  }
1596  info("set Output EPort phase FPGA "+itos(fe)+" - Ch "+itos(ch)+" : "+itos(data),"FEB_v1::setOutputEPort");
1597  return StatusCode::SUCCESS;
1598 }
1599 
1600 int FEB_v1::clockPhaseEport (int fe, int ch){
1602  return ((m_seqPga->spiRead(14+ch)>>6)&0x3F);
1603 }
1604 
1605 int FEB_v1::latencyEport (int fe, int ch){
1607  return (m_seqPga->spiRead(14+ch)&0x3F);
1608 }
1609 
1610 //=============================================================================
1611 //
1612 //=============================================================================
1613 
1616  int registers[8]={
1617  65, 89, 113, 137, 161, 185, 209, 232
1618  };
1619  int zero = 0;
1620  int one = 7;
1621  for ( int i =0; i<8; ++i){
1622  int val = m_seqPga->i2cRead(registers[i]);
1623  int val0 = val & (0b10001111);
1624  int val1 = val | (0b1110000);
1625  StatusCode stat1 = m_seqPga->i2cWrite(registers[i], val1);
1626  StatusCode stat0 = m_seqPga->i2cWrite(registers[i], val0);
1627  if (stat0.isFailure() || stat1.isFailure()){
1628  warning("Could not reset DLL register "+itos(registers[i])+" of GBT "+itos(gbt));
1629  return StatusCode::FAILURE;
1630  }
1631  }
1632  info("Reset of the DLL of GBT "+itos(gbt));
1633  return StatusCode::SUCCESS;
1634 }
1635 
1636 //=============================================================================
1637 //
1638 //=============================================================================
1639 
1640 int FEB_v1::gbtStatus(int gbt){
1642  int status_gbt = (m_seqPga->i2cRead(431) >> 2);
1643  if (status_gbt==24){
1644  info("GBT status is 0d"+ itos(status_gbt),"GBT Config");
1645  }
1646  else {
1647  error("GBT status is 0d"+ itos(status_gbt),"GBT Config");
1648  }
1649  return status_gbt;
1650 }
1651 
1652 //=============================================================================
1653 //
1654 //=============================================================================
1655 
1658  if (m_seqPga->i2cWrite(365, 170).isFailure()){
1659  warning("Cannot acknowledge configuration of GBT "+itos(gbt));
1660  return StatusCode::FAILURE;
1661  }
1662  return StatusCode::SUCCESS;
1663 }
1664 
1665 //=============================================================================
void info(std::string mymsg)
Definition: Object.h:38
StatusCode setThreshold(int, int)
Definition: FEB_v1.cpp:695
std::string itos(int)
Definition: Tools.cpp:46
bool gbtEnableEport(int)
Definition: FEB_v1.cpp:1515
StatusCode setGbtTermEport(int, bool)
Definition: FEB_v1.cpp:1284
void readFifoLLTFE(int fe, int dump)
Definition: FEB_v1.cpp:160
void addDataStream(std::string, std::string)
Definition: Data.cpp:31
StatusCode setLatencyLLTUpNb(int)
Definition: FEB_v1.cpp:1042
StatusCode setTestDuration(int)
Definition: FEB_v1.cpp:511
StatusCode setMaskLLTCorner(bool)
Definition: FEB_v1.cpp:1141
bool isFailure() const
Definition: StatusCode.h:68
void writeFifoSpyFE(int fe)
Definition: FEB_v1.cpp:266
Definition: RAM.h:16
StatusCode setSpyModeSeq(bool)
Definition: FEB_v1.cpp:653
bool oldSubtract(int)
Definition: FEB_v1.cpp:795
int latencyEport(int)
Definition: FEB_v1.cpp:1580
StatusCode resetFifoSpyFE(int)
Definition: FEB_v1.cpp:471
int gbtStatus(int)
Definition: FEB_v1.cpp:1640
StatusCode setPseudoADCEnable(int, int, bool)
Definition: FEB_v1.cpp:856
int m_mask1
Definition: FEB_v1.h:193
bool clock80MHzFallingEdge()
Definition: FEB_v1.cpp:971
int m_latency0
Definition: FEB_v1.h:195
RAM * m_ramSpy[3]
Definition: FEB_v1.h:200
bool disableSubtract(int)
Definition: FEB_v1.cpp:754
int m_mask2
Definition: FEB_v1.h:194
StatusCode dataFill(int, double)
Definition: Data.cpp:85
int gbtTrackMode(int)
Definition: FEB_v1.cpp:1268
int m_fifoLLTAddress[3]
Definition: FEB_v1.h:185
StatusCode setSize(unsigned int, unsigned int)
Definition: RAM.cpp:29
bool gbtTermEport(int)
Definition: FEB_v1.cpp:1322
int gbtClockStrength(int)
Definition: FEB_v1.cpp:1542
StatusCode setGbtEnableEport(int, bool)
Definition: FEB_v1.cpp:1491
StatusCode gbtAcknowledgeConfig(int)
Definition: FEB_v1.cpp:1656
StatusCode setSpiAdd(unsigned long int)
Definition: SeqPGA.cpp:255
void writeFifoLLT()
Definition: FEB_v1.cpp:283
void add(int attribut)
Definition: Attrib.h:67
int m_fifoSpyAddress[3]
Definition: FEB_v1.h:184
StatusCode setMaskLLTSideNb(int, bool)
Definition: FEB_v1.cpp:1169
void maskLLT()
Definition: FEB_v1.cpp:1091
void setName(std::string name)
Definition: Object.h:51
int m_fifoDepth
Definition: FEB_v1.h:179
int m_gbtAddress[4]
Definition: FEB_v1.h:182
void readFifoLLT(int dump)
Definition: FEB_v1.cpp:200
void latencyLLT()
Definition: FEB_v1.cpp:1009
StatusCode clear(int)
Definition: Data.cpp:71
int m_fifoInjectAddress[3]
Definition: FEB_v1.h:186
int threshold(int)
Definition: FEB_v1.cpp:708
int statusRegister(int)
Definition: FEB_v1.cpp:501
int m_seqAddress
Definition: FEB_v1.h:180
bool injectModeFE(int)
Definition: FEB_v1.cpp:818
bool spyModeSeq()
Definition: FEB_v1.cpp:661
FEB_v1()
Standard constructor.
Definition: FEB_v1.cpp:18
StatusCode setGain4(int, int, bool)
Definition: FEB_v1.cpp:829
int m_icecalAddress[8]
Definition: FEB_v1.h:183
virtual ~FEB_v1()
Destructor.
Definition: FEB_v1.cpp:107
SeqPGA * m_seqPga
Definition: FEB_v1.h:188
StatusCode setGbt80MHzClkEport(int)
Definition: FEB_v1.cpp:1338
bool globalPseudoPMEnable(int)
Definition: FEB_v1.cpp:922
void setType(std::string type)
Definition: Object.h:52
void error(std::string mymsg)
Definition: Object.h:40
StatusCode setOldSubtract(int, bool)
Definition: FEB_v1.cpp:783
int testDuration(int fpga)
Definition: FEB_v1.cpp:537
void debug(std::string mymsg)
Definition: Object.h:37
StatusCode setGbtClockStrength(int, int)
Definition: FEB_v1.cpp:1528
int latency(int)
Definition: FEB_v1.cpp:731
StatusCode setEnableBXIDReset(bool)
Definition: FEB_v1.cpp:765
StatusCode i2cRead()
Definition: SeqPGA.cpp:510
StatusCode setI2cAdd(unsigned long int)
Definition: SeqPGA.cpp:482
StatusCode setSpareForTrigEnable(int, int)
Definition: FEB_v1.cpp:631
StatusCode setInjectModeFE(int, bool)
Definition: FEB_v1.cpp:806
bool spyModeFE(int)
Definition: FEB_v1.cpp:684
bool enableBXIDReset()
Definition: FEB_v1.cpp:773
int m_mask0
Definition: FEB_v1.h:192
bool clockFallingEdge(int, int)
Definition: FEB_v1.cpp:949
StatusCode setGbtDLLEport(int)
Definition: FEB_v1.cpp:1390
StatusCode resetFifoInjectFE(int)
Definition: FEB_v1.cpp:481
void writeFifoLLTFE(int fe)
Definition: FEB_v1.cpp:444
unsigned int * m_fifo[3]
Definition: FEB_v1.h:189
StatusCode spiWrite(unsigned int, unsigned int, unsigned int *)
Definition: SeqPGA.cpp:321
StatusCode setClock80MHzFallingEdge(bool)
Definition: FEB_v1.cpp:959
void writeDataFifoInjectFE(int, int *, int *, int *, int *)
Definition: FEB_v1.cpp:426
StatusCode setOutputEport(int, int, int)
Definition: FEB_v1.cpp:1564
int gbtMode(int)
Definition: FEB_v1.cpp:1202
bool pseudoPMEnable(int, int)
Definition: FEB_v1.cpp:899
StatusCode setProbeEnable(int, bool)
Definition: FEB_v1.cpp:603
UsbFTMLInterface * usb()
Definition: SeqPGA.h:75
void setAddress(U32 address)
Definition: IOobject.h:84
StatusCode setGbtTrackMode(int, int)
Definition: FEB_v1.cpp:1252
StatusCode setMaskLLT(int, bool)
Definition: FEB_v1.cpp:1115
StatusCode setGbtMode(int, int)
Definition: FEB_v1.cpp:1184
StatusCode setPseudoPMEnable(int, int, bool)
Definition: FEB_v1.cpp:883
void readFifoSpyFE(int fe, int dump)
Definition: FEB_v1.cpp:121
StatusCode i2cWrite()
Definition: SeqPGA.cpp:535
StatusCode setLatencyLLTSideNb(int)
Definition: FEB_v1.cpp:1058
SeqPGA * seqPga()
Definition: FEB_v1.h:63
bool stopInjLoop(int)
Definition: FEB_v1.cpp:584
Data * data()
Definition: FEB_v1.h:147
int m_feAddress[8]
Definition: FEB_v1.h:181
int * m_ch[4]
Definition: FEB_v1.h:190
int m_latency1
Definition: FEB_v1.h:196
virtual void addChild(Hierarchy *element)
Definition: Hierarchy.cpp:83
StatusCode setGlobalPseudoPMEnable(int, bool)
Definition: FEB_v1.cpp:910
StatusCode setLatencyLLTCorner(int)
Definition: FEB_v1.cpp:1074
StatusCode setCalibCte(int, int, int)
Definition: FEB_v1.cpp:982
void readFifoInjectFE(int fe, int dump)
Definition: FEB_v1.cpp:236
StatusCode setLatency(int, int)
Definition: FEB_v1.cpp:719
StatusCode setDisableSubtract(int, bool)
Definition: FEB_v1.cpp:742
int clockPhaseEport(int)
Definition: FEB_v1.cpp:1575
StatusCode gbtDLLReset(int)
Definition: FEB_v1.cpp:1614
bool pseudoADCEnable(int, int)
Definition: FEB_v1.cpp:872
StatusCode setGbtDataPath(int, int, int, int)
Definition: FEB_v1.cpp:1220
StatusCode setMaskLLTUpNb(int, bool)
Definition: FEB_v1.cpp:1155
Definition: Data.h:16
Data * m_data
Definition: FEB_v1.h:191
void probeEnable()
Definition: FEB_v1.cpp:620
RAM * m_fifoUsbTest
Definition: FEB_v1.h:201
void readFifo(int, int, unsigned int *)
Definition: FEB_v1.cpp:113
void warning(std::string mymsg)
Definition: Object.h:39
RAM * m_ramInj[3]
Definition: FEB_v1.h:199
StatusCode spiRead(unsigned int, unsigned int, unsigned int *)
Definition: SeqPGA.cpp:337
bool gain4(int, int)
Definition: FEB_v1.cpp:845
StatusCode setClockFallingEdge(int, int, bool)
Definition: FEB_v1.cpp:933
StatusCode setSpyModeFE(int, bool)
Definition: FEB_v1.cpp:672
Definition: SeqPGA.h:23
bool gbt80MHzClkEport(int)
Definition: FEB_v1.cpp:1373
int spareForTrigEnable(int)
Definition: FEB_v1.cpp:642
int calibCte(int, int)
Definition: FEB_v1.cpp:998
StatusCode setLatencyLLT(int)
Definition: FEB_v1.cpp:1026
int m_latency2
Definition: FEB_v1.h:197
int gbtDataPath(int)
Definition: FEB_v1.cpp:1239
void writeFifoInjectFE(int fe, int pattern)
Definition: FEB_v1.cpp:298
void gbtDLLEport(int)
Definition: FEB_v1.cpp:1467
int m_latency3
Definition: FEB_v1.h:198
int m_fifoTrigAddress[3]
Definition: FEB_v1.h:187
StatusCode resetFE(int)
Definition: FEB_v1.cpp:491
StatusCode setSpiGBTSCA(bool)
Definition: SeqPGA.cpp:165
StatusCode setStopInjLoop(bool)
Definition: FEB_v1.cpp:558