Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • how do we enable the low-rate readout group since the tpr process doesn't participate in the collection mechanism?  rough proposal: set in cnf file (so shared by both tpr and daq), timing system would program, and control would somehow display
  • currently caf needs the relative rates of the two readout groups.  would be nice if it could be "learned" somehow using the dgram env bits with readout group info, but deadtime can eliminate some of those events.

Interpolation Algorithm Iteration

Discussion on July 10, 2023

current algorithm:
- a udp packet comes in
- interpolate() runs at a low rate, is called which computes 349 points ("slowratio" param 350)
- puts high-rate results in SPSC queue ("interpolate" queue)
- process() wakes up when entry is on interpolate queue (polling) and pulls (runs at a high rate)
- pushes result to the pvQueue (not yet a datagram)
- _matchUp() running in the daq l1accept thread
  o pulls it from pvQueue and puts the data in the dgram (first time it really
    has a timestamp)

proposed revised algorithm:
- a udp packet comes in
- puts entry in a queue (either SPSC or pvQueue)
- check the env for low/high rate event, in L1Accept thread:
  - if low-rate: wait/poll for pvQueue
    o check that the frame-counter increments appropriately, maybe time it out if it's the last
      in the run.  set damage if time-out or frame-counter skips
  - if high-rate: interpolate using timestamp (have to cache the high-rate event until we get
    a "bounding" low-rate event: a memory buffer)

for comparison, pvadetector algorithm:
- process() runs in epics thread (not l1accept thread)
- gets a buffer from a free-list and fills it with PV data put on the pv-queue (already timestamped)
- require same number of free-list buffers as pebble-buffers (allows deadtime
  to protect the free-list buffers: need to get this idea into encoder)

protecting buffering:
- ideally size the pvQueue so it is "bigger" than the dmaQueue.  then deadtime protects
  the pvQueue from overflow.
  o pvQueue is a low-rate queue, while dmaQueue is high-rate
- 2044 dma buffers +10% (204) for extra firmware buffers
- then we need (2044+204)/350 pvQueue buffers