Belle II Software  release-05-02-19
Merger.cc
1 //-----------------------------------------------------------------------------
2 // $Id$
3 //-----------------------------------------------------------------------------
4 // Filename : Merger.cc
5 // Section : TRG CDC
6 // Owner : Yoshihito Iwasaki
7 // Email : yoshihito.iwasaki@kek.jp
8 //-----------------------------------------------------------------------------
9 // Description : A class to represent a CDC Merger board
10 //-----------------------------------------------------------------------------
11 // $Log$
12 // 2013,1005 first working verion 0.00
13 // 1014 added the unpacker part
14 //-----------------------------------------------------------------------------
15 
16 #define TRGCDC_SHORT_NAMES
17 
18 #include <algorithm>
19 #include <iostream>
20 #include <iomanip>
21 #include "trg/trg/Debug.h"
22 #include "trg/trg/State.h"
23 #include "trg/trg/Channel.h"
24 #include "trg/cdc/TRGCDC.h"
25 #include "trg/cdc/Merger.h"
26 #include "trg/cdc/FrontEnd.h"
27 #include "trg/cdc/Wire.h"
28 
29 using namespace std;
30 
31 namespace Belle2 {
37  TRGCDCMerger::TRGCDCMerger(const std::string& name,
38  unitType type,
39  const TRGClock& systemClock,
40  const TRGClock& dataClock,
41  const TRGClock& userClockInput,
42  const TRGClock& userClockOutput)
43  : TRGBoard(name, systemClock, dataClock, userClockOutput, userClockOutput),
44  _type(type),
45  _misb(0),
46  _mosb(0)
47  {
48  userClockInput.name(); //jb
49  }
50 
52  {
53  }
54 
55  string
57  {
58  return ("TRGCDCMerger version 0.00");
59  }
60 
62  TRGCDCMerger::type(void) const
63  {
64  return _type;
65  }
66 
67 
68  int
70  ofstream& outfile)
71  {
72 
73  // string cname = "UNKNOWN";
74  // if (_type == innerType)
75  outfile << "-- inner type" << endl;
76  string cname = "TRGCDCMergerInner";
77  // }
78  // else {
79  // outfile << "-- outer type" << endl;
80  // cname = "TRGCDCMergerOuter";
81  // }
82 
83  outfile << "--" << endl;
84  outfile << endl;
85  outfile << " component " << cname << endl;
86  // int err = implementationPort(type, outfile);
87  outfile << " end component;" << endl;
88 
89  outfile << "--------------------------------------------------------------"
90  << endl;
91 
92  outfile << "entity " << cname << "is" << endl;
93  int err = implementationPort(type, outfile);
94  outfile << "end " << cname << ";" << endl;
95  outfile << endl;
96  outfile << "architecture Behavioral of " << cname << " is" << endl;
97  outfile << " -- local" << endl;
98  outfile << endl;
99  outfile << "begin" << endl;
100  outfile << "end Behavioral;" << endl;
101 
102  return err;
103  }
104 
105 
106  int
108  ofstream& outfile)
109  {
110  outfile << " port (" << endl;
111 
112  //...125MHz clock (TRG system clock)...
113  outfile << " -- 127.216MHz clock (TRG system clock)" << endl;
114  outfile << " clk : in std_logic;" << endl;
115 
116  //...Coarse timing...
117  outfile << " -- Coarse timing (counter with 127.216MHz clock)" << endl;
118  outfile << " tmc : in std_logic_vector(0 to 7);" << endl;
119 
120  //...Hit pattern...
121  outfile << " -- Hit pattern(80 bits for 80 wires)" << endl;
122  outfile << " ptn : in std_logic_vector(0 to 80);" << endl;
123 
124  //...Fine timing for each wire...
125  /*
126  outfile << " -- Fine timing within 127.216MHz clock" << endl;
127  for (unsigned i = 0; i < 80; i++) {
128  outfile << " w" << TRGUtil::itostring(i)
129  << " : in std_logic_vector(0 to 3);" << endl;
130  }
131  */
132 
133  //...Hit pattern output...
134  outfile << " -- Hit pattern output" << endl;
135  outfile << " hit : out std_logic_vector(0 to 80);" << endl;
136  outfile << " -- 4 bit fine timing for 16 priority wires" << endl;
137  outfile << " pri : out std_logic_vector(0 to 63);" << endl;
138  outfile << " -- 2 bit fine timing for the fastest hit in 16 TS" << endl;
139  outfile << " fst : out std_logic_vector(0 to 31)" << endl;
140  outfile << " );" << endl;
141 
142  return 0;
143  }
144 
145  void
147  {
148  std::vector<const TRGCDCFrontEnd*>::push_back(a);
149  }
150 
151  void
152  TRGCDCMerger::dump(const string& message, const string& pre) const
153  {
154  TRGBoard::dump(message, pre);
155  }
156 
157  void
159  {
160 
161  TRGDebug::enterStage("Merger simulattion");
162 
163  //...Clear input signal bundle...
164  if (_misb) {
165  for (unsigned i = 0; i < _misb->size(); i++)
166  delete(* _misb)[i];
167  delete _misb;
168  }
169  if (_mosb) {
170  for (unsigned i = 0; i < _mosb->size(); i++)
171  delete(* _mosb)[i];
172  delete _mosb;
173  }
174 
175  //...Clock...
176  const TRGClock& dClock = clockData();
177 
178  // ... Make input signal bundle .... ???
179  TRGSignalVector input(name() + "inputFrontEnds", dClock);
180  const string ni = name() + "InputSignalBundle";
181  _misb = new TRGSignalBundle(ni, dClock);
182 
183 
184  // Input from FrontEnds
185  // const unsigned nFrontEnds = size();
186 
187  // TRGSignalBundle* testin = ((*this)[0])->_osb;
188  // TRGSignalBundle testin2 = new TRGSignalBundle( ((*this)[0])->output() );
189  //TRGSignalBundle * testin = new TRGSignalBundle * ((*this)[0]->output());
190  //TRGSignalVector * input1 = new TRGSignalVector ( *(((*this)[0]->_osb)[0])[0] ),
191  // * input2 = new TRGSignalVector ( *(((*this)[1]->_osb)[0])[0] );
192 
193 
194  // _osb in FrontEnd.h is private, use getOSB() to get input bundle.
195  TRGSignalVector* input1 = new TRGSignalVector(*((*(*this)[0]->getOSB())[0]));
196  TRGSignalVector* input2 = new TRGSignalVector(*((*(*this)[1]->getOSB())[0]));
197 
198 
199  for (unsigned s = 0; s < input1->size(); s++) {
200  TRGSignal ws = (*input1)[s];
201  input += ws;
202  }
203  for (unsigned s = 0; s < input2->size(); s++) {
204  TRGSignal ws = (*input2)[s];
205  input += ws;
206  }
207 
208  //...Create FrontEnd output data
209  TRGSignalVector* fedata = new TRGSignalVector(input);
210  fedata->clock(dClock);
211  fedata->name(name() + "@dataClock");
212  _misb->push_back(fedata);
213 
214 // cout<<"Merger input start"<<endl;
215 // _misb->dump("detail", TRGDebug::tab());
216 // cout<<"Merger input end"<<endl;
217 
218  //...Data clock...
219  // Data clock position data is omitted. Is this problem?
220 
221  //...Make output signal bundle...
222  const string no = name() + "OutSigBundle";
223  if (type() == innerType) {
224  _mosb = new TRGSignalBundle(no,
225  dClock,
226  * _misb,
227  256,
228  TCMerger::packerInner);
229  } else if (type() == outerType) {
230  _mosb = new TRGSignalBundle(no,
231  dClock,
232  * _misb,
233  256,
234  TCMerger::packerOuter);
235  }
236  mosb = _mosb;
237 
238  if (TRGCDC::getTRGCDC()->firmwareSimulationMode() & 0x2)
239  mosb->dumpCOE("",
240  TRGCDC::getTRGCDC()->firmwareSimulationStartDataClock(),
241  TRGCDC::getTRGCDC()->firmwareSimulationStopDataClock());
242 
243  //...Output to a channel...
244  output(0)->signal(_mosb);
245 
246  // Terminate
247  delete input1;
248  delete input2;
249 
250  if (TRGDebug::level() > 1) {
251  _misb->dump("", TRGDebug::tab());
252  _mosb->dump("", TRGDebug::tab());
253  }
254 
255  TRGDebug::leaveStage("Merger simulattion");
256  }
257 
258 
259  TRGState
260  TCMerger::packerInner(const TRGState& input)
261  {
262 
263  //...inputInsdie should be 32 hit pattern and 2x16x5 timing, total 192 bits...
264  // plus edge information
265  //
266  // Wire numbers and TS ID
267  //
268  // outside
269  //
270  // +--+--+--+--+- -+--+--+--+--+--+--+
271  // | 79 | 78 | .... | 66 | 65 | 64 |
272  // +--+--+--+--+--+- -+--+--+--+--+--+--+
273  // | 63 | 62 | ..... | 50 | 49 | 48 |
274  // +--+--+--+--+--+- -+--+--+--+--+--+--+
275  // | 47 | 46 | .... | 34 | 33 | 32 |
276  // +--+--+--+--+- -+--+--+--+--+--+--+
277  //
278  // +--+--+--+--+- -+--+--+--+--+--+--+
279  // | 31 | 30 | .... | 18 | 17 | 16 |
280  // +--+--+--+--+--+- -+--+--+--+--+--+--+
281  // | 15 | 14 | ..... | 2 | 1 | 0 |
282  // +--+--+--+--+--+- -+--+--+--+--+--+--+
283  // | x | x | .... | x | x | x |
284  // +--+--+--+--+- -+--+--+--+--+--+--+
285  //
286  // 15 14 .... 2 1 0 <- partial TS ID, aligned with the 2nd row
287  //
288  // inside
289  //
290  //...Prepare a state for output...
291  // hit map: 80x1
292  // priority hit time: 16x4
293  // fastest hit time: 16x4
294  // 2nd proi. hit flag: 16x1
295  // edge time info: 5x4
296  // cc: 1x9
297  // N/A and reserved: fill to total 256 bits
298 
299  TRGState s(80 + 16 * 4 + 16 * 4 + 16 + 5 * 4 + 1 * 9 + 3); // fill to 256 bits
300 
301  //...Set up bool array...
302  bool* binput = new bool[input.size()];
303  input.copy2bool(binput);
304  bool* binside = & binput[0];
305  bool* boutside = & binput[256]; // half of the input.size(), should be 256
306 
307 
308  // ... hitmap ...
309  const bool* const hitptn0 = & binside[0]; // 16x2 = 32 bits
310  const bool* const hitptn1 = & boutside[0]; // 16x3 = 48 bits
311  s.set(0, 32, hitptn0);
312  s.set(32, 48, hitptn1);
313  unsigned p = 80;
314 
315  bool PTS_in_hit[16];
316  bool PTS_out_hit[16];
317  for (unsigned i = 0; i < 16; i++) {
318  if (i == 0) {
319  PTS_in_hit[i] = hitptn0[0] || hitptn0[16];
320  PTS_out_hit[i] = hitptn1[0] || hitptn1[1] || hitptn1[16] || hitptn1[17] || hitptn1[32] || hitptn1[33] || hitptn1[34];
321  } else if (i == 1) {
322  PTS_in_hit[i] = hitptn0[1] || hitptn0[16] || hitptn0[17];
323  PTS_out_hit[i] = hitptn1[0] || hitptn1[1] || hitptn1[2] || hitptn1[16] || hitptn1[17] || hitptn1[18] || hitptn1[32] || hitptn1[33]
324  || hitptn1[34] || hitptn1[35];
325  } else if (i == 14) {
326  PTS_in_hit[i] = hitptn0[14] || hitptn0[29] || hitptn0[30];
327  PTS_out_hit[i] = hitptn1[13] || hitptn1[14] || hitptn1[15] || hitptn1[28] || hitptn1[29] || hitptn1[30] || hitptn1[31]
328  || hitptn1[44] || hitptn1[45] || hitptn1[46] || hitptn1[47];
329  } else if (i == 15) {
330  PTS_in_hit[i] = hitptn0[15] || hitptn0[30] || hitptn0[31];
331  PTS_out_hit[i] = hitptn1[14] || hitptn1[15] || hitptn1[29] || hitptn1[30] || hitptn1[31] || hitptn1[45] || hitptn1[46]
332  || hitptn1[47];
333  } else {
334  PTS_in_hit[i] = hitptn0[i] || hitptn0[i + 15] || hitptn0[i + 16];
335  PTS_out_hit[i] = hitptn1[i - 1] || hitptn1[i] || hitptn1[i + 1] || hitptn1[i + 14] || hitptn1[i + 15] || hitptn1[i + 16]
336  || hitptn1[i + 17] || hitptn1[i + 30] || hitptn1[i + 31] || hitptn1[i + 32] || hitptn1[i + 33] || hitptn1[i + 34];
337  }
338  }
339 
340 
341  // ... priority time ... and 2nd priority location .... already prepared in FrontEnd packer
342  const bool* const pt[16] = {
343  &binside[33], &binside[38], &binside[43], &binside[48],
344  &binside[53], &binside[58], &binside[63], &binside[68],
345  &binside[73], &binside[78], &binside[83], &binside[88],
346  &binside[93], &binside[98], &binside[103], &binside[108]
347  };
348 
349  for (unsigned i = 0; i < 16; i++) {
350  s.set(p, 4, pt[i]);
351  p += 4;
352  }
353 
354  // ... fastest time ...
355  const bool* const ftinside[16] = {
356  &binside[128], &binside[133], &binside[138], &binside[143],
357  &binside[148], &binside[153], &binside[158], &binside[163],
358  &binside[168], &binside[173], &binside[178], &binside[183],
359  &binside[188], &binside[193], &binside[198], &binside[203]
360  };
361  const bool* const ftoutside[16] = {
362  &boutside[48], &boutside[53], &boutside[58], &boutside[63],
363  &boutside[68], &boutside[73], &boutside[78], &boutside[83],
364  &boutside[88], &boutside[93], &boutside[98], &boutside[103],
365  &boutside[108], &boutside[113], &boutside[118], &boutside[123]
366  };
367 
368 
369  // need to consider if that area is hit
370  for (unsigned i = 0; i < 16; i++) {
371  TRGState st[2];
372  st[0] = TRGState(5, ftinside[i]);
373  st[1] = TRGState(5, ftoutside[i]);
374  if (!PTS_in_hit[i]) st[0].set(5, true);
375  if (!PTS_out_hit[i]) st[1].set(5, true);
376 
377  if (PTS_in_hit[i] || PTS_out_hit[i]) {
378  if (st[0] < st[1]) {
379  s.set(p, 4, &binside[129 + i * 5]);
380  } else {
381  s.set(p, 4, &boutside[49 + i * 5]);
382  }
383  } else {
384  }
385  p += 4;
386  }
387 
388  // ... 2nd priority location ...
389  s.set(p, 16, &binside[112]);
390  p += 16;
391 
392  // ... edge information ...
393 
394  if (hitptn0[31]) {
395  s.set(p, 4, &binside[209]); // 4-bit hit time of cell[31]
396  } else {
397  }
398  p += 4;
399 
400 
401  if (hitptn1[32]) {
402  s.set(p, 4, &boutside[129]); // 4-bit hit time of cell[64]
403  } else {
404  }
405  p += 4;
406 
407 
408  if (hitptn1[0] || hitptn1[16] || hitptn1[32] || hitptn1[33]) {
409  s.set(p, 4, &boutside[134]); // edge info. purely from outside FE. cell 32, 48, 64, 65
410  } else {
411  }
412  p += 4;
413 
414 
415 
416  TRGState et[2]; // edge info. from both FE, cell 31 and 47, 62, 63, 78, 79
417  et[0] = TRGState(5, &binside[208]);
418  et[1] = TRGState(5, &boutside[138]);
419 
420  if ((!hitptn1[15]) && (!hitptn1[30]) && (!hitptn1[31]) && (!hitptn1[46]) && (!hitptn1[47])) et[1].set(5, true);
421  if ((!hitptn0[31])) et[0].set(5, true);
422 
423  if (hitptn0[31] || hitptn1[15] || hitptn1[30] || hitptn1[31] || hitptn1[46] || hitptn1[47]) {
424  if (et[0] < et[1]) {
425  s.set(p, 4, &binside[209]);
426  } else {
427  s.set(p, 4, &boutside[139]);
428  }
429  } else {
430  }
431 
432  p += 4;
433 
434 
435 
436  if (hitptn1[31] || hitptn1[47]) {
437  s.set(p, 4, &boutside[144]); // edge info. purely from outside FE. cell 63, 79
438  } else {
439  }
440 //p+=4;
441 
442  // ...clock counter ...
443  // no process for cc at this moment
444 
445  // ...N/A and reserved bit ...
446  // no process for these at this moment
447 
448 //...Debug...
449  if (TRGDebug::level() > 1) {
450  unpackerInner(input, s);
451  }
452 
453 //...Termination...
454  delete[] binput;
455 
456  return s;
457  }
458 
459 
460 
461 
462  TRGState
463  TCMerger::packerOuter(const TRGState& input)
464  {
465 
466  // packerOuter: for SuperLayer 1 - 8
467  //
468  // inputInsdie should be 48 hit pattern and 1x16x5 + 1x16x5 timing,
469  // plus edge information
470  // total 192 bits... (whole data pack 256 bits)
471  //
472  // inputOutside should be 48 hit pattern and 1x16x5 + 1x16x5 timing,
473  // plus edge information
474  // total 192 bits... (whole data pack 256 bits)
475  //
476  // Wire numbers and TS ID
477  //
478  // Outside
479  //
480  // +--+--+--+--+- -+--+--+--+--+--+--+
481  // | x | x | .... | x | x | x |
482  // +--+--+--+--+--+- -+--+--+--+--+--+--+
483  // | 79 | 78 | ..... | 66 | 65 | 64 |
484  // +--+--+--+--+--+- -+--+--+--+--+--+--+
485  // | 63 | 62 | .... | 50 | 49 | 48 |
486  // +--+--+--+--+--+- -+--+--+--+--+--+
487  //
488  // +--+--+--+--+- -+--+--+--+--+--+--+
489  // | 47 | 46 | .... | 34 | 33 | 32 |
490  // +--+--+--+--+--+- -+--+--+--+--+--+--+
491  // | 31 | 30 | ..... | 18 | 17 | 16 |
492  // +--+--+--+--+--+- -+--+--+--+--+--+--+
493  // | 15 | 14 | .... | 2 | 1 | 0 |
494  // +--+--+--+--+- -+--+--+--+--+--+--+
495  //
496  // 15 14 .... 2 1 0 <- partial TS ID
497  //
498  //...Prepare a state for output...
499  // hit map: 80x1
500  // priority hit time: 16x4
501  // fastest hit time: 16x4
502  // 2nd proi. hit flag: 16x1
503  // edge time info: 3x4
504  // cc: 1x9
505  // N/A and reserved: fill to total 256 bits
506  TRGState s(80 + 16 * 4 + 16 * 4 + 16 + 3 * 4 + 9 + 11);
507 
508 
509  bool* binput = new bool[input.size()];
510  input.copy2bool(binput);
511  bool* binside = & binput[0];
512  bool* boutside = & binput[256]; // half of the input.size(), should be 256
513 
514 
515  // ... hitmap ...
516  const bool* const hitptn0 = & binside[0]; // 16x3 = 48 bits
517  const bool* const hitptn1 = & boutside[0]; // 16x2 = 32 bits
518  s.set(0, 48, hitptn0);
519  s.set(48, 32, hitptn1);
520 
521  bool PTS_in_hit[16];
522  bool PTS_out_hit[16];
523  for (unsigned i = 0; i < 16; i++) {
524  if (i == 0) {
525  PTS_in_hit[i] = hitptn0[0] || hitptn0[1] || hitptn0[16] || hitptn0[32] ;
526  PTS_out_hit[i] = hitptn1[0] || hitptn1[16] || hitptn1[17];
527  } else if (i == 15) {
528  PTS_in_hit[i] = hitptn0[14] || hitptn0[15] || hitptn0[30] || hitptn0[31] || hitptn0[47] ;
529  PTS_out_hit[i] = hitptn1[14] || hitptn1[15] || hitptn1[30] || hitptn1[31];
530  } else {
531  PTS_in_hit[i] = hitptn0[i - 1] || hitptn0[i] || hitptn0[i + 1] || hitptn0[i + 15] || hitptn0[i + 16] || hitptn0[i + 32];
532  PTS_out_hit[i] = hitptn1[i - 1] || hitptn1[i] || hitptn1[i + 15] || hitptn1[i + 16] || hitptn1[i + 17];
533  }
534  }
535 
536  // ... priority time ...
537  /*
538  const bool * const ptinside[16] = {
539  &binside[49], &binside[54], &binside[59], &binside[64],
540  &binside[69], &binside[74], &binside[79], &binside[84],
541  &binside[89], &binside[94], &binside[99], &binside[104],
542  &binside[109], &binside[114], &binside[119], &binside[124]
543  };
544  const bool * const ptoutside[16] = {
545  &boutside[49], &boutside[54], &boutside[59], &boutside[64],
546  &boutside[69], &boutside[74], &boutside[79], &boutside[84],
547  &boutside[89], &boutside[94], &boutside[99], &boutside[104],
548  &boutside[109], &boutside[114], &boutside[119], &boutside[124]
549  };
550  */
551 
552  // i = 0...15
553  // inside binside[31+i]
554  // outside boutside[i]
555 // const bool scflag[2] = {false, true};
556  const bool dummy[6] = {false, false, false, false, false, true};
557  const TRGState stDummy(6, dummy);
558  unsigned p = 80;
559 
560  for (unsigned i = 0; i < 16; i++) {
561  //unsigned sc=0;
562  if (hitptn0[32 + i]) {
563  s.set(p, 4, &binside[49 + 5 * i]);;
564  } else {
565  // decide which 2nd priority time to use if 1st priority cell not hit
566  TRGState st[2];
567  if (i == 0) {
568  if (hitptn1[0]) {
569  s.set(p, 4, &boutside[49]);
570 // sc = 1;
571  s.set(208 + i, 1, true);
572  } else {
573 // sc = 0;
574 // s.set(209+i, 1, &scflag[sc]);
575  }
576  } else {
577  st[0] = TRGState(5, &boutside[43 + i * 5]);
578  st[1] = TRGState(5, &boutside[48 + i * 5]);
579  if (!hitptn1[i - 1]) st[0].set(5, true);
580  if (!hitptn1[i]) st[1].set(5, true);
581 
582  if (hitptn1[i] || hitptn1[i - 1]) {
583  if (st[1] < st[0]) {
584  s.set(p, 4, &boutside[49 + i * 5]);
585  s.set(208 + i, 1, true); // only set scflag to true when left is it and also faster
586  } else {
587 // sc = 1;
588  s.set(p, 4, &boutside[44 + i * 5]);
589  }
590  } else {
591  }
592 
593 
594  }
595 
596  }
597 // s.set(209+i, 1, &scflag[sc]); //the scflag is only consider when (1st not hit) && (2nd is hit)
598  p += 4;
599  }
600 
601 
602  // ... fastest time ...
603 
604 
605 
606 
607  /*
608  const bool * const ftinside[16] = {
609  &binside[129], &binside[134], &binside[139], &binside[144],
610  &binside[149], &binside[154], &binside[159], &binside[164],
611  &binside[169], &binside[174], &binside[179], &binside[184],
612  &binside[189], &binside[194], &binside[199], &binside[204]
613  };
614  const bool * const ftoutside[16] = {
615  &boutside[129], &boutside[134], &boutside[139], &boutside[144],
616  &boutside[149], &boutside[154], &boutside[159], &boutside[164],
617  &boutside[169], &boutside[174], &boutside[179], &boutside[184],
618  &boutside[189], &boutside[194], &boutside[199], &boutside[204]
619  };
620  */
621  // need to consider if those areas are hit
622  p = 144;
623  for (unsigned i = 0; i < 16; i++) {
624  TRGState st[2];
625  st[0] = TRGState(5, &binside[128 + i * 5]);
626  st[1] = TRGState(5, &boutside[128 + i * 5]);
627 
628  if (!PTS_in_hit[i]) st[0].set(5, true);
629  if (!PTS_out_hit[i]) st[1].set(5, true);
630 
631  if (PTS_in_hit[i] || PTS_out_hit[i]) {
632  if (st[0] < st[1]) {
633  s.set(p, 4, &binside[129 + i * 5]);
634  } else {
635  s.set(p, 4, &boutside[129 + i * 5]);
636  }
637  } else {
638  }
639  /*
640  if ( st[0] < st[1] ) {
641  s.set(p, 4, &binside[129 + i*5]);
642  }
643  else {
644  s.set(p, 4, &boutside[129 + i*5]);
645  }
646  */
647 
648  p += 4;
649  }
650 
651  // ... edge information ...
652  /*
653  const bool * const etinside[16] = {&binside[209], &binside[214] };
654  const bool * const etoutside[16] = {&boutside[209], &boutside[214] };
655  */
656  p = 224;
657 
658  if (hitptn1[15]) {
659  s.set(p, 4, &boutside[124]); // 4-bit hit time of cell[63]
660  }
661 
662  for (unsigned i = 0; i < 2; i++) {
663  TRGState et[2];
664  // need to consider if the two areas hit
665  et[0] = TRGState(5, &binside[208 + i * 5]);
666  et[1] = TRGState(5, &boutside[208 + i * 5]);
667 
668  if (i == 0) {
669  if (!hitptn0[0]) et[0].set(5, true);
670  if (!hitptn1[16]) et[1].set(5, true);
671  p += 4;
672  if (hitptn0[0] || hitptn1[16]) {
673  if (et[0] < et[1]) {
674  s.set(p, 4, &binside[209 + i * 5]);
675  } else {
676  s.set(p, 4, &boutside[209 + i * 5]);
677  }
678  } else {
679  }
680 
681  } else if (i == 1) {
682  if (!hitptn0[15] && !hitptn0[31]) et[0].set(5, true);
683  if (!hitptn1[15] && !hitptn1[31]) et[1].set(5, true);
684  p += 4;
685  if (hitptn0[15] || hitptn0[31] || hitptn1[15] || hitptn1[31]) {
686  if (et[0] < et[1]) {
687  s.set(p, 4, &binside[209 + i * 5]);
688  } else {
689  s.set(p, 4, &boutside[209 + i * 5]);
690  }
691  } else {
692  }
693 
694 
695  }
696  // p += 4;
697  } // warning, here 'p' is at the beginning position of the last sensible data
698 
699 
700  // ...clock counter ...
701  // no process for cc at this moment
702 
703  // ...N/A and reserved bit ...
704  // no process for these at this moment
705 
706 
707 //...Debug...
708  if (TRGDebug::level() > 1) {
709  unpackerOuter(input, s);
710  }
711 
712 //...Termination...
713  delete[] binput;
714  return s;
715 
716  }
717 
718 
719 
720 
721  void
722  TCMerger:: unpackerInner(const TRGState& input,
723  const TRGState& output)
724  {
725 
726  TRGState inputInside = input.subset(0, 256);
727  TRGState inputOutside = input.subset(256, 256);
728 
729  unsigned ipos = 0, o = 0;
730 
731  cout << "======================= Merger unpackerInner ================================= " << endl;
732  cout << "input bit information: " << endl;
733  for (unsigned bi = 0; bi < input.size(); bi++) {
734  if (input[bi]) cout << "* " ;
735  else cout << ". ";
736  if ((bi % 16) == 15) cout << endl;
737  if (bi == 255) cout << "--------------------------------" << endl;
738  }
739 
740  cout << "Input bit size = " << input.size() << " and Output bit size =" << output.size() << endl << endl;
741 
742  cout << "Hit map: " << endl;
743  cout << "inputOutside : wire hit pattern" << endl;
744  cout << " ";
745  for (unsigned i = 0; i < 48; i++) {
746  const unsigned j = 47 - i;
747  if (i && ((i % 8) == 0))
748  cout << "_";
749  if (inputOutside[j])
750  cout << "*";
751  else
752  cout << ".";
753  }
754  cout << endl;
755  cout << "inputInside : wire hit pattern" << endl;
756  cout << " ";
757  for (unsigned i = 0; i < 32; i++) {
758  const unsigned j = 31 - i;
759  if (i && ((i % 8) == 0))
760  cout << "_";
761  if (inputInside[j])
762  cout << "*";
763  else
764  cout << ".";
765  }
766  cout << endl;
767  cout << "-------------------------------------------" << endl;
768  cout << "Output : wire hit pattern" << endl;
769  cout << " ";
770  for (unsigned i = 0; i < 80; i++) {
771  const unsigned j = 79 - i;
772  if ((i % 16) == 0) {
773  cout << endl << " ";
774  if (int(i / 16) % 2) {
775  } else cout << " ";
776  }
777  if (output[j])
778  cout << "O ";
779  else
780  cout << ". ";
781  }
782  cout << endl;
783  cout << " -=+=-=+=-=-=+=-=+=-=-=+=-=+=-=-=+=-=+=-=-=+=-=+=-" << endl << endl;
784 
785  cout << "Priority cell timing:" << endl;
786  cout << "inputOutside : no priority cell timing information" << endl;
787  cout << "inputInside : priority cell timing" << endl;
788  ipos = 32;
789  for (unsigned i = 0; i < 16; i++) {
790  TRGState s = inputInside.subset(ipos + i * 5, 5);
791  if ((i % 4) == 0)
792  cout << " ";
793  cout << setw(2) << i << ": " << s << " ";
794  if ((i % 4) == 3)
795  cout << endl;
796  }
797  cout << "inputInsidepriority cell location flag" << endl;
798  ipos = 112;
799  for (unsigned i = 0; i < 16; i++) {
800  if ((i % 4) == 0)
801  cout << " ";
802  if (inputInside[ipos + i])
803  cout << setw(2) << i << ": (1)Left ";
804  else
805  cout << setw(2) << i << ": (0)Right ";
806  if ((i % 4) == 3)
807  cout << endl;
808  }
809 
810  cout << "ouput : priority cell timing" << endl;
811  o = 80;
812  for (unsigned i = 0; i < 16; i++) {
813  TRGState s = output.subset(o + i * 4, 4);
814  if ((i % 4) == 0)
815  cout << " ";
816  cout << setw(2) << i << ": " << s << " ";
817  if ((i % 4) == 3)
818  cout << endl;
819  }
820  cout << "output : priority cell location flag" << endl;
821  o = 208;
822  for (unsigned i = 0; i < 16; i++) {
823  if ((i % 4) == 0)
824  cout << " ";
825  if (output[o + i])
826  cout << setw(2) << i << ": (1)Left ";
827  else
828  cout << setw(2) << i << ": (0)Right ";
829  if ((i % 4) == 3)
830  cout << endl;
831  }
832  cout << " -=+=-=+=-=-=+=-=+=-=-=+=-=+=-=-=+=-=+=-=-=+=-=+=-=" << endl << endl;
833 
834  cout << "Fastest timing of each TrackSegment: " << endl;
835  cout << "inputOutside : fastest timing" << endl;
836  ipos = 128;
837  for (unsigned i = 0; i < 16; i++) {
838  TRGState s = inputOutside.subset(ipos + i * 5, 5);
839  if ((i % 4) == 0)
840  cout << " ";
841  cout << setw(2) << i << ": " << s << " ";
842  if ((i % 4) == 3)
843  cout << endl;
844  }
845  ipos = 48;
846  cout << "inputInside : fastest timing" << endl;
847  for (unsigned i = 0; i < 16; i++) {
848  TRGState s = inputInside.subset(ipos + i * 5, 5);
849  if ((i % 4) == 0)
850  cout << " ";
851  cout << setw(2) << i << ": " << s << " ";
852  if ((i % 4) == 3)
853  cout << endl;
854  }
855  cout << "output : fastest timing" << endl;
856  o = 144;
857  for (unsigned i = 0; i < 16; i++) {
858  TRGState s = output.subset(o + i * 4, 4);
859  if ((i % 4) == 0)
860  cout << " ";
861  cout << setw(2) << i << ": " << s << " ";
862  if ((i % 4) == 3)
863  cout << endl;
864  }
865  cout << " -=+=-=+=-=-=+=-=+=-=-=+=-=+=-=-=+=-=+=-=-=+=-=+=-=" << endl << endl;
866 
867  cout << "Edge time information: " << endl;
868  cout << "inputOutside : timing of missing wires" << endl;
869  ipos = 128;
870  for (unsigned i = 0; i < 4; i++) {
871  TRGState s = inputOutside.subset(ipos + i * 5, 5);
872  if ((i % 4) == 0)
873  cout << " ";
874  cout << setw(2) << i << ": " << s << " ";
875  if ((i % 4) == 3)
876  cout << endl;
877  } cout << endl;
878  ipos = 208;
879  cout << "inputInside : timing of missing wires" << endl;
880  for (unsigned i = 0; i < 1; i++) {
881  TRGState s = inputInside.subset(ipos + i * 5, 5);
882  if ((i % 4) == 0)
883  cout << " ";
884  cout << setw(2) << i << ": " << s << " ";
885  if ((i % 4) == 3)
886  cout << endl;
887  } cout << endl;
888  cout << "output : timing of missing wires" << endl;
889  o = 224;
890  for (unsigned i = 0; i < 5; i++) {
891  TRGState s = output.subset(o + i * 4, 4);
892  if ((i % 4) == 0)
893  cout << " ";
894  cout << setw(2) << i << ": " << s << " ";
895  if ((i % 4) == 3)
896  cout << endl;
897  }
898  cout << endl;
899 
900  cout << "================== End of Merger unpackerInner ========================= " << endl;
901 
902 
903  }
904 
905 
906 
907  void
908  TCMerger:: unpackerOuter(const TRGState& input,
909  const TRGState& output)
910  {
911 
912  TRGState inputInside = input.subset(0, 256);
913  TRGState inputOutside = input.subset(256, 256);
914 
915  unsigned o = 0;
916 
917  cout << "======================= Merger unpackerOuter================================== " << endl;
918  cout << "input bit information: " << endl;
919  for (unsigned bi = 0; bi < input.size(); bi++) {
920  if (input[bi]) cout << "* " ;
921  else cout << ". ";
922  if ((bi % 16) == 15) cout << endl;
923  if (bi == 255) cout << "--------------------------------" << endl;
924  }
925 
926  cout << "Input bit size = " << input.size() << " and Output bit size =" << output.size() << endl << endl;
927 
928  cout << "Hit map: " << endl;
929  cout << "inputOutside : wire hit pattern" << endl;
930  cout << " ";
931  for (unsigned i = 0; i < 48; i++) {
932  const unsigned j = 47 - i;
933  if (i && ((i % 8) == 0))
934  cout << "_";
935  if (inputOutside[j])
936  cout << "*";
937  else
938  cout << ".";
939  }
940  cout << endl;
941  cout << "inputInside : wire hit pattern" << endl;
942  cout << " ";
943  for (unsigned i = 0; i < 48; i++) {
944  const unsigned j = 48 - i - 1;
945  if (i && ((i % 8) == 0))
946  cout << "_";
947  if (inputInside[j])
948  cout << "*";
949  else
950  cout << ".";
951  }
952  cout << endl;
953  cout << "-------------------------------------------" << endl;
954  cout << "Output : wire hit pattern" << endl;
955  cout << " ";
956  for (unsigned i = 0; i < 80; i++) {
957  const unsigned j = 79 - i;
958  /*
959  if (i && ((i % 8) == 0))
960  cout << "_";
961  if (output[j])
962  cout << "* ";
963  else
964  cout << ". ";
965  if ( (i % 32) == 31 ) cout << endl << " ";
966  */
967  if ((i % 16) == 0) {
968  cout << endl << " ";
969  if (int(i / 16) % 2) {
970  } else cout << " ";
971  }
972  if (output[j])
973  cout << "O ";
974  else
975  cout << ". ";
976  // if ( (i % 32) == 31 ) cout << endl << " ";
977  }
978  cout << endl;
979  cout << " -=+=-=+=-=-=+=-=+=-=-=+=-=+=-=-=+=-=+=-=-=+=-=+=-" << endl << endl;
980 
981  cout << "Priority cell timing:" << endl;
982  cout << "inputOutside : priority cell timing" << endl;
983  o = 48;
984  for (unsigned i = 0; i < 16; i++) {
985  TRGState s = inputOutside.subset(o + i * 5, 5);
986  if ((i % 4) == 0)
987  cout << " ";
988  cout << setw(2) << i << ": " << s << " ";
989  if ((i % 4) == 3)
990  cout << endl;
991  }
992  cout << "inputInside : priority cell timing" << endl;
993  for (unsigned i = 0; i < 16; i++) {
994  TRGState s = inputInside.subset(o + i * 5, 5);
995  if ((i % 4) == 0)
996  cout << " ";
997  cout << setw(2) << i << ": " << s << " ";
998  if ((i % 4) == 3)
999  cout << endl;
1000  }
1001  cout << "ouput : priority cell timing" << endl;
1002  o = 80;
1003  for (unsigned i = 0; i < 16; i++) {
1004  TRGState s = output.subset(o + i * 4, 4);
1005  if ((i % 4) == 0)
1006  cout << " ";
1007  cout << setw(2) << i << ": " << s << " ";
1008  if ((i % 4) == 3)
1009  cout << endl;
1010  }
1011  cout << "output : priority cell location flag" << endl;
1012  o = 208;
1013  for (unsigned i = 0; i < 16; i++) {
1014  if ((i % 4) == 0)
1015  cout << " ";
1016  if (output[o + i])
1017  cout << setw(2) << i << ": (1)Left ";
1018  else
1019  cout << setw(2) << i << ": (0)Right ";
1020  if ((i % 4) == 3)
1021  cout << endl;
1022  }
1023  cout << " -=+=-=+=-=-=+=-=+=-=-=+=-=+=-=-=+=-=+=-=-=+=-=+=-=" << endl << endl;
1024 
1025  cout << "Fastest timing of each TrackSegment: " << endl;
1026  cout << "inputOutside : fastest timing" << endl;
1027  o = 128;
1028  for (unsigned i = 0; i < 16; i++) {
1029  TRGState s = inputOutside.subset(o + i * 5, 5);
1030  if ((i % 4) == 0)
1031  cout << " ";
1032  cout << setw(2) << i << ": " << s << " ";
1033  if ((i % 4) == 3)
1034  cout << endl;
1035  }
1036  cout << "inputInside : fastest timing" << endl;
1037  for (unsigned i = 0; i < 16; i++) {
1038  TRGState s = inputInside.subset(o + i * 5, 5);
1039  if ((i % 4) == 0)
1040  cout << " ";
1041  cout << setw(2) << i << ": " << s << " ";
1042  if ((i % 4) == 3)
1043  cout << endl;
1044  }
1045  cout << "output : fastest timing" << endl;
1046  o = 144;
1047  for (unsigned i = 0; i < 16; i++) {
1048  TRGState s = output.subset(o + i * 4, 4);
1049  if ((i % 4) == 0)
1050  cout << " ";
1051  cout << setw(2) << i << ": " << s << " ";
1052  if ((i % 4) == 3)
1053  cout << endl;
1054  }
1055  cout << " -=+=-=+=-=-=+=-=+=-=-=+=-=+=-=-=+=-=+=-=-=+=-=+=-=" << endl << endl;
1056 
1057  cout << "Edge time information: " << endl;
1058  cout << "inputOutside : timing of missing wires" << endl;
1059  o = 208;
1060  for (unsigned i = 0; i < 2; i++) {
1061  TRGState s = inputOutside.subset(o + i * 5, 5);
1062  if ((i % 4) == 0)
1063  cout << " ";
1064  cout << setw(2) << i << ": " << s << " ";
1065  if ((i % 4) == 3)
1066  cout << endl;
1067  } cout << endl;
1068  cout << "inputInside : timing of missing wires" << endl;
1069  for (unsigned i = 0; i < 2; i++) {
1070  TRGState s = inputInside.subset(o + i * 5, 5);
1071  if ((i % 4) == 0)
1072  cout << " ";
1073  cout << setw(2) << i << ": " << s << " ";
1074  if ((i % 4) == 3)
1075  cout << endl;
1076  } cout << endl;
1077  cout << "output : timing of missing wires" << endl;
1078  o = 224;
1079  for (unsigned i = 0; i < 3; i++) {
1080  TRGState s = output.subset(o + i * 4, 4);
1081  if ((i % 4) == 0)
1082  cout << " ";
1083  cout << setw(2) << i << ": " << s << " ";
1084  if ((i % 4) == 3)
1085  cout << endl;
1086  }
1087  cout << endl;
1088 
1089  cout << "================= End of Merger unpackerOuter ========================= " << endl;
1090 
1091 
1092  }
1093 
1094  void //Dump all the details of _mosb into a .log file, do it in the end of simulate()
1096  {
1097  if (type() == innerType) {
1098  dump_log_inner();
1099  } else {
1100  dump_log_outer();
1101  }
1102  }
1103 
1104  void
1106  {
1107 
1108  const TRGClock& dClock = TRGCDC::getTRGCDC()->dataClock();
1109  ofstream output((name() + ".log").c_str());
1110 
1111  output << "Inner Superlayer Merger output dump" << endl << endl;
1112 
1113  const std::vector<int> changetime = _mosb->stateChanges();
1114  std::vector<vector<int>> boolvector(changetime.size());
1115  for (unsigned ch_t = 0; ch_t < changetime.size(); ch_t++) {
1116 
1117  for (unsigned b = 0; b < (* _mosb)[0]->size(); b++) {
1118  boolvector[ch_t].push_back(((* _mosb)[0]->state(changetime[ch_t])[b]) ? 1 : 0);
1119  }
1120 
1121  output << "# of clk: " << changetime[ch_t] << " (" << dClock.absoluteTime(changetime[ch_t]) << " ns), signal vector: " << endl;
1122 
1123  output << "Hitmap: " << endl << " ";
1124  for (int b = 0; b < 80; b++) {
1125  output << boolvector[ch_t][79 - b] << " ";
1126  if (b == 15) output << endl;
1127  else if (b == 31) output << endl << " ";
1128  else if (b == 47) output << endl ;
1129  else if (b == 63) output << endl << " ";
1130  }
1131  output << endl;
1132 
1133  for (int b = 0; b < 16; b++) {
1134  output << "PT#" << b << ": " << boolvector[ch_t][ 80 + 4 * b + 3 ] << boolvector[ch_t][ 80 + 4 * b + 2 ] << boolvector[ch_t][ 80 + 4
1135  * b + 1 ]
1136  << boolvector[ch_t][ 80 + 4 * b ] << endl;
1137  }
1138  output << endl;
1139 
1140  for (int b = 0; b < 16; b++) {
1141  output << "FT#" << b << ": " << boolvector[ch_t][ 144 + 4 * b + 3 ] << boolvector[ch_t][ 144 + 4 * b + 2 ] << boolvector[ch_t][ 144
1142  + 4 * b + 1 ]
1143  << boolvector[ch_t][ 144 + 4 * b ] << endl;
1144  }
1145 
1146  output << "Secondary: " << endl;
1147  for (int b = 0; b < 16; b++) {
1148  output << boolvector[ch_t][ 223 - b ] ;
1149  }
1150 
1151  output << endl;
1152  output << "ET#0(31): " << endl << boolvector[ch_t][227] << boolvector[ch_t][226] << boolvector[ch_t][225] << boolvector[ch_t][224]
1153  << endl;
1154  output << "ET#1(64(out32)): " << endl << boolvector[ch_t][231] << boolvector[ch_t][230] << boolvector[ch_t][229] <<
1155  boolvector[ch_t][228]
1156  << endl;
1157  output << "ET#2(32, 48, 64, 65(outside 0, 16, 32, 33)): " << endl << boolvector[ch_t][235] << boolvector[ch_t][234] <<
1158  boolvector[ch_t][233]
1159  << boolvector[ch_t][232] << endl;
1160  output << "ET#3(31, 47, 62, 63, 78, 79(inside 31, outside 15, 30, 31, 46, 47)): " << endl << boolvector[ch_t][239] <<
1161  boolvector[ch_t][238]
1162  << boolvector[ch_t][237] << boolvector[ch_t][236] << endl;
1163  output << "ET#4(63, 79(outside 31, 47)): " << endl << boolvector[ch_t][243] << boolvector[ch_t][242] << boolvector[ch_t][241]
1164  << boolvector[ch_t][240] << endl;
1165 
1166 
1167 
1168  output << endl;
1169  }
1170 
1171  output.close();
1172 
1173  }
1174 
1175  void
1177  {
1178 
1179  const TRGClock& dClock = TRGCDC::getTRGCDC()->dataClock();
1180  ofstream output((name() + ".log").c_str());
1181 
1182  output << "Outer Superlayer Merger output dump" << endl << endl;
1183 
1184  const std::vector<int> changetime = _mosb->stateChanges();
1185  std::vector<vector<int>> boolvector(changetime.size());
1186  for (unsigned ch_t = 0; ch_t < changetime.size(); ch_t++) {
1187 
1188  for (unsigned b = 0; b < (* _mosb)[0]->size(); b++) {
1189  boolvector[ch_t].push_back(((* _mosb)[0]->state(changetime[ch_t])[b]) ? 1 : 0);
1190  }
1191 
1192  output << "# of clk: " << changetime[ch_t] << " (" << dClock.absoluteTime(changetime[ch_t]) << " ns), signal vector: " << endl;
1193 
1194  output << "Hitmap: " << endl << " ";
1195  for (int b = 0; b < 80; b++) {
1196  output << boolvector[ch_t][79 - b] << " ";
1197  if (b == 15) output << endl;
1198  else if (b == 31) output << endl << " ";
1199  else if (b == 47) output << endl ;
1200  else if (b == 63) output << endl << " ";
1201  }
1202  output << endl;
1203 
1204  for (int b = 0; b < 16; b++) {
1205  output << "PT#" << b << ": " << boolvector[ch_t][ 80 + 4 * b + 3 ] << boolvector[ch_t][ 80 + 4 * b + 2 ] << boolvector[ch_t][ 80 + 4
1206  * b + 1 ]
1207  << boolvector[ch_t][ 80 + 4 * b ] << endl;
1208  }
1209  output << endl;
1210 
1211  for (int b = 0; b < 16; b++) {
1212  output << "FT#" << b << ": " << boolvector[ch_t][ 144 + 4 * b + 3 ] << boolvector[ch_t][ 144 + 4 * b + 2 ] << boolvector[ch_t][ 144
1213  + 4 * b + 1 ]
1214  << boolvector[ch_t][ 144 + 4 * b ] << endl;
1215  }
1216 
1217  output << "Secondary: ";
1218  for (int b = 0; b < 16; b++) {
1219  output << boolvector[ch_t][ 223 - b ] ;
1220  }
1221 
1222  output << endl;
1223  output << "ET#0(63(outside 15)): " << endl << boolvector[ch_t][227] << boolvector[ch_t][226] << boolvector[ch_t][225] <<
1224  boolvector[ch_t][224]
1225  << endl;
1226  output << "ET#1(0,64(inside 0, out 16)): " << endl << boolvector[ch_t][231] << boolvector[ch_t][230] << boolvector[ch_t][229]
1227  << boolvector[ch_t][228] << endl;
1228  output << "ET#2(15,31,63,79(inside 15, 31, outside 15, 31)): " << endl << boolvector[ch_t][235] << boolvector[ch_t][234]
1229  << boolvector[ch_t][233] << boolvector[ch_t][232] << endl;
1230 
1231  output << endl;
1232  }
1233 
1234 
1235  output.close();
1236 
1237  }
1238 
1239 
1241 } // namespace Belle2
Belle2::TRGCDCMerger::dump_log_inner
void dump_log_inner(void) const
dump_log for inner Merger
Definition: Merger.cc:1105
Belle2::TRGSignalBundle::dumpCOE
void dumpCOE(const std::string &fileName="", int start=0, int stop=0) const
makes coe output.
Definition: SignalBundle.cc:305
Belle2::TRGSignal
A class to represent a digitized signal. Unit is nano second.
Definition: Signal.h:28
Belle2::TRGSignalBundle::stateChanges
std::vector< int > stateChanges(void) const
returns a list of clock position of state change.
Definition: SignalBundle.cc:216
Belle2::TRGCDCMerger::_mosb
TRGSignalBundle * _mosb
outptu signal bundle
Definition: Merger.h:137
Belle2::TRGBoard
A class to represent a trigger board.
Definition: Board.h:30
Belle2::TRGDebug::level
static int level(void)
returns the debug level.
Definition: Debug.cc:72
Belle2::TRGBoard::clockData
const TRGClock & clockData(void) const
returns data clock.
Definition: Board.h:128
Belle2::TRGCDCMerger::unitType
unitType
enum of unitType
Definition: Merger.h:41
Belle2::TRGCDCMerger::simulate
void simulate(void)
simulates firmware.
Definition: Merger.cc:158
Belle2::TRGState
A class to represent a state of multi bits.
Definition: State.h:29
Belle2::TRGCDCMerger::implementationPort
static int implementationPort(const unitType &type, std::ofstream &)
writes a port map.
Definition: Merger.cc:107
Belle2::TRGCDCFrontEnd
A class to represent a CDC front-end board.
Definition: FrontEnd.h:36
Belle2::TRGCDC::dataClock
const TRGClock & dataClock(void) const
returns the data clock.
Definition: TRGCDC.h:983
Belle2::TRGSignalBundle
A class to represent a bundle of SignalVectors.
Definition: SignalBundle.h:31
Belle2::TRGClock::name
const std::string & name(void) const
returns name.
Definition: Clock.h:162
Belle2::TRGCDCMerger::dump_log
void dump_log(void) const
Dump all the details of _mosb into a .log file, do it in the end of simulate()
Definition: Merger.cc:1095
Belle2::TRGCDCMerger::implementation
static int implementation(const unitType &type, std::ofstream &)
make a VHDL component file.
Definition: Merger.cc:69
Belle2::TRGCDCMerger::dump
void dump(const std::string &message="", const std::string &pre="") const
dumps contents. "message" is to select information to dump. "pre" will be printed in head of each lin...
Definition: Merger.cc:152
Belle2::TRGCDCMerger::dump_log_outer
void dump_log_outer(void) const
dump_log for outer Merger
Definition: Merger.cc:1176
Belle2::TRGCDCMerger::push_back
void push_back(const TRGCDCFrontEnd *)
push back TRGCDCFrontEnd of this Merger
Definition: Merger.cc:146
Belle2::TRGChannel::signal
TRGSignalBundle * signal(void) const
returns signal.
Definition: Channel.h:99
Belle2::TRGBoard::output
TRGChannel * output(unsigned i) const
returns output channel i.
Definition: Board.h:170
Belle2::TRGSignalVector::clock
const TRGClock & clock(void) const
returns clock.
Definition: SignalVector.h:130
Belle2::TRGCDCMerger::version
static std::string version(void)
return version.
Definition: Merger.cc:56
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TRGCDCMerger::_misb
TRGSignalBundle * _misb
Input single bundle.
Definition: Merger.h:134
Belle2::TRGCDC::getTRGCDC
static TRGCDC * getTRGCDC(void)
returns TRGCDC object.
Definition: TRGCDC.cc:190
Belle2::TRGCDCMerger::~TRGCDCMerger
virtual ~TRGCDCMerger()
Destructor.
Definition: Merger.cc:51
Belle2::TRGCDCMerger::type
unitType type(void) const
return type.
Definition: Merger.cc:62
Belle2::TRGDebug::tab
static std::string tab(void)
returns tab spaces.
Definition: Debug.cc:52
Belle2::TRGClock::absoluteTime
double absoluteTime(int clockPosition) const
returns absolute time of clock position
Definition: Clock.cc:133
Belle2::TRGDebug::leaveStage
static void leaveStage(const std::string &stageName)
Declare that you leave a stage.
Definition: Debug.cc:39
Belle2::TRGDebug::enterStage
static void enterStage(const std::string &stageName)
Declare that you enter new stage.
Definition: Debug.cc:29
Belle2::TRGCDCMerger::_type
unitType _type
Unit type.
Definition: Merger.h:131
Belle2::TRGClock
A class to represent a digitized signal. Unit is nano second.
Definition: Clock.h:43
Belle2::TRGSignalVector
A class to represent a bundle of digitized signals.
Definition: SignalVector.h:31
Belle2::TRGCDCMerger::mosb
TRGSignalBundle * mosb
Output signal bundle. not the best way to do this though.
Definition: Merger.h:81
Belle2::TRGBoard::input
const TRGChannel * input(unsigned i) const
returns input channel i.
Definition: Board.h:163