Final-ish version of the timing test

Urs and Simon,

Sorry about all the changes to gui/PixParTab.cc and main/mkConfig. My emacs setup automatically removes blank space at the end of a line. Normally it's not a problem, but those two files have a ton of lines like this, which is a pain. Let me know if you have too many conflicts merging the files. I can turn this off and recreate the files using the latest build.

Doug
Simon,

Yes, the reason the daqStart-Stop sequence is within the two TBM Clock
Phase loops is that after I change the TBM Clock Phase, I can no longer
read data until I restart the DAQ (a.k.a it doesn't work when I move the
reset outside the loops). What I think is happening is that the firmware in
the FPGA can no longer latch to the 400 MHz stream after I change the TBM
Clock Phase, or the latching is only done at the DAQ start. I think this is
happening because I can still program the ROCs but I can't readout data, so
the 40MHz stream still works. So yes, the code would run much faster if the
daq reset were outside the two loops, but unfortunately I don't know how to
read the 400MHz data after changing the TBM Clock Phase.

Also, I rebased my code in git and created a new pull request.

Doug

On Thu, Oct 23, 2014 at 8:27 AM, simonspa <notifications@github.com> wrote:

> In tests/PixTestTiming.cc:
>
> > +      else nROCsPort[0].at(1)++;
> > +    } else {
> > +      nROCs[1]++;
> > +      if (rocIds[iROC]<12) nROCsPort[1].at(0)++;
> > +      else nROCsPort[1].at(1)++;
> > +    }
> > +  }
> > +
> > +  // Loop through all possible TBM phase settings.
> > +  bool goodTBMPhase = false;
> > +  for (int iclk160 = 0; iclk160 < 8 && !(goodTBMPhase && fFastScan); iclk160++) {
> > +    for (int iclk400 = 0; iclk400 < 8 && !(goodTBMPhase && fFastScan); iclk400++) {
> > +      uint8_t delaysetting = iclk160<<5 | iclk400<<2;
> > +      fApi->setTbmReg("basee", delaysetting, 0); //Set TBM 160-400 MHz Clock Phase
> > +      LOG(logINFO) << "160MHz Phase: " << iclk160 << " 400MHz Phase: " << iclk400 << " Delay Setting: " << bitset<8>(delaysetting).to_string();
> > +      fApi->daqStart();
>
> is there a reason for putting this inside the two loops? You could gain
> some time if you would run everything on one DAQ session.
>
> On the other hand I see the danger of mixing data, especially when the TBM
> readout is not stable...
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/psi46/pxar/pull/243/files#r19276449>.
>