Difference between revisions of "Compton DAQ Dev"

From Hall A Wiki
Jump to: navigation, search
(Current Problems)
(Current Problems)
Line 103: Line 103:
 
== [[Current Problems]] ==
 
== [[Current Problems]] ==
 
<pre>
 
<pre>
Oct 13, 2022, see update Oct 14 below.  R. Michaels
+
Nov 9, 2022
  
Yesterday a problem was overcome: wrong firmware.
+
Current status, globally, is that without the VTP the  
vtpInit: VTP_FW_Version=0x10004, VTP_FW_Type=19
+
DAQ runs with a front panel trigger at 50 Hz and reads
VTP_FW_Type 19 is the SoLID ECAL test firmware, needed 15 for Compton.
+
the FADC and VETROC. Data looks ok. Adding the VTP causes problems.
Ben fixed it by editing
+
/usr/local/vtp/params/firmwares/vtp_firmware.txt
+
  
Problematic symptoms today:
 
  
Considering the VTP vtp_list.c
+
Problems today
  
Running the DAQ with a 50 Hz pulser for the FP TI input.
+
1. There are complaints that I cannot vtpSetCompton_EnableScalerReadout
 +
using firwmare 15.  Probably the least of my problems.
  
With the following default combination
+
2. Something wrong with VTP Serdes links. 
  
    #define USE_DMA
+
It takes several seconds to time out.
    #define READOUT_TI
+
Waiting on links: PP1 PP2 PP3 PP4 ... (etc)
    #define READOUT_VTP
+
vtpSerdesCheckLinks: ERROR - all serdes links not up!
  
The DAQ was limited to 1.5 Hz.  The VTP produced 10 words which
+
3. What library to use ?
were featureless (always the same numbers).  I don't know what
+
the VTP should produce.
+
  
Using the following, all components ran at 50 Hz, but it's just info,
+
vtpEbResetFifo defined in /mnt/SBS/coda/3.10_arm/Linux-armv7l/lib/libvtp.so
it's not what we want.
+
but not in /home/sbs-onl/comptonDaq/vtp/libvtp.so
 +
I'm told not to use /mnt/SBS/coda/3.10_arm/Linux-armv7l/lib/
  
    #define USE_DMA
+
Pulling the libvtp from the SBS HCAL setup, I see that it
    #define READOUT_TI
+
is also quite different. Which one to use ?
// #define READOUT_VTP
+
  
Using the following, all components ran at 50 Hz, but the code did not
+
Generally, the fact that the readout code I got referred to routines that
compile, as is.  I had to replace gpDmaBuf (undefined anywhere) with pBuf. 
+
are not in my libraries, I assume I must have a mismatch of readout code
It seemed to be what we wanted, but I'm not sure.  
+
and library from the Compton polarimeter.
  
// #define USE_DMA
+
4. Bus errors for (nearly) any code with the string "Ti" in it. But not all.
    #define READOUT_TI
+
    #define READOUT_VTP
+
  
However, every event produces a timeout.  Printouts on the havtp1 ROC:
+
See "Bob1" in the readout list to show the lines that are commented out.
  
  {vtpEbTiEventReadErrors=1}
+
It looks like any code with the string "Ti" in it (presumably tries to talk
  {vtpEbEventReadErrors=8051}
+
to the TI) causes a bus error. 
  vtpEbReadEvent: TIMEOUT ERROR (cnt=8052)
+
  
the 8051 and 8052 increment with each event.
+
5. To USE_DMA or not ?
  
Questions, partially answered.
+
Different behavior whether I do
Questions
+
#define USE_DMA
 +
or
 +
//#define USE_DMA
  
1. What data is the VTP supposed to produce ?
+
Whether I USE_DMA or not ...
  I suppose it is "diagnostic event data" to confirm trigger decisions.
+
  
Answer is basically yes.  Ben gave me the doc VTP_trigger.pdf (see Documents).
+
With all the lines commented out that causes bus error,
 +
the DAQ goes into an active state but usually gets no events
 +
i.e. rocTrigger() is not entered.
  
 +
The DAQ does go through all the transitions without problems.
 +
if those lines are commented out.
 +
Again, see "Bob1" in the readout list.
  
2. What causes the data to be ready ?
 
  Perhaps I am missing a link.
 
 
When the VTP ROL gets the trigger ready signal (from a link it has to the TI, it polls a register) it starts 2 DMA transfers: one for the TI event info (see READOUT_TI in vtp_list.c) and another for the VTP firmware specific event info (see READOUT_VTP also). Then the ROL waits for the TI DMA engine to finish (indicating an event was fully ready or there was  a timeout) and then the same thing follows for the VTP event.
 
 
I need to check which register and see how it gets set.
 
 
3. Where is vtpEbTiReadEvent defined ?  I did not see it
 
  in the library.
 
 
Ok, I have inconsistent libraries.  It would be nice to have the sources
 
for the library that is actually used.  I'll search around on github.
 
 
[sbs-onl@havtp1 ~]$ nm $CODA/Linux-armv7l/lib/libvtp.so | grep vtpEbTiReadEvent
 
00024914 T vtpEbTiReadEvent
 
[sbs-onl@havtp1 ~]$
 
[sbs-onl@havtp1 ~]$ nm /home/sbs-onl/comptonDaq/vtp/libvtp.so | grep vtpEbTiReadEvent
 
------- nothing ^^^^ -------
 
 
[sbs-onl@havtp1 ~]$ nm $CODA/Linux-armv7l/lib/libvtp.so | grep vtpEbTiReadEvent
 
00024914 T vtpEbTiReadEvent
 
[sbs-onl@havtp1 ~]$ nm /home/sbs-onl/comptonDaq/vtp/libvtp.so | grep vtpEbTiReadEvent
 
 
 
4. Is there a special significance to gpDmaBuf and where is
 
  it defined ?
 
 
A bit of a mystery, but I htink it's similar to 3.  The sources I have are inconsistent.
 
 
Update Oct 14
 
 
I'm told I should use the library in /home/sbs-onl/comptonDaq/vtp/libvtp.so
 
instead of /mnt/SBS/coda/3.10_arm/Linux-armv7l/lib/libvtp.so and that the VTP ROL
 
should use vtpTiLinkReadEvent instead of  vtpEbTiReadEvent.  BTW, I was also
 
forced to use  vtpTiLinkResetFifo(0) instead of vtpEbResetFifo().
 
Got vtp_list.c to compile and download but it segfaults in Prestart,
 
somewhere around where it reads the parameters.
 
Seems this dies
 
//  VTP_READ_CONF_FILE;
 
and if I comment it out then this dies
 
//seems to dump core  vtpTiLinkStatus();
 
So it looks like I have a corrupted library somehow.
 
  
 
---------------------------------------------------------------------------------
 
---------------------------------------------------------------------------------

Revision as of 14:39, 9 November 2022

Here are some notes on the project of developing the Compton counting mode DAQ. The original work was done mainly by Bryan Moffit and Ben Raydo in 2020, with input from others.

It is foreseen to be a precurser of a moller polarimeter DAQ as well as a counting-mode DAQ for the MOLLER project, etc.

See earlier work https://hallaweb.jlab.org/wiki/index.php/Compton_Counting_DAQ_Software_HOWTO

Budget and Plan

          Budget and Plan

 Upgrade of Compton and Moller polarimeter DAQ in halls A and C.

 The 4 systems are approximately the same.  The FADC will be modified
 to support both counting mode and integrating mode.  

 Item      Price each      Qty       Line cost

 VXS crate   16.5 k        4         66 k
 VTP         10 k          4         40 k
 FADC (was not in budget)
 cpu (ATOM)   3 k          4         12 k
 SD           2 k          4          8 k
 scaler       4 k          4         16 k
 VETROC       2 k          8         16 k
 TI           2 k          4          8 k
 I/O          1.5 k        4          6 k
 Spares                              43 k
 ==========================================
 TOTAL                              215 k$
 
It's essentially 43k$ per DAQ (times 5 since we need spares)
except we must scrounge the FADCs.  We'll buy the first system
for the hall C moller in FY2023.  This 43k$ is in the FY2023 budget.
After that we may need to refine the design.  Then in FY2024 we'll
purchase/build 3 more DAQs.  Finally, buy spares in FY2025.

Documents

VTP manual https://userweb.jlab.org/~rom/compton/VTP-Manual.pdf

Compton Trigger https://userweb.jlab.org/~rom/compton/Compton_Trigger_2020.pdf

Current Test Setup

updated R. Michaels Oct 12, 2022

Here is a picture https://userweb.jlab.org/~rom/compton/polarimeter_daq.xfig.pdf

The basic configuration of the DAQ

DAQ config: https://userweb.jlab.org/~rom/compton/haVTP_config.png

ROC1 : https://userweb.jlab.org/~rom/compton/roc1_config.png

VTP : https://userweb.jlab.org/~rom/compton/vtpROC_config.png

How to Run the Current Setup

This is a VXS crate located in the TEDF building cubicle 11. The crate is at the top of the rack. The crate was formerly installed in hall A during PREX/CREX.

updated Oct 12, 2022.  R. Michaels

How to login to the two ROCs and start the ROC

ssh -X amoll1 -l sbs-onl
./startroc1

ssh -X havtp1 -l sbs-onl
./startRoc

How to start CODA on atedf3.  Username adaq.

kcoda

startcoda

VTP readout
havtp1:/home/sbs-onl/comptonDaq/vtp/rol/vtp_list.so
ROC1 readout
amoll1:/home/sbs-onl/comptonDaq/rol/vtpCompton_list.so

Oct 12, 2022.
Currently using a 50 Hz front-panel pulser trigger on TI.
Later want to modify this to use a trigger from VTP based on data
from FADC and/or the VETROC.

If I drop the VTP from the readout and remove tiRocEnable(2)
from amoll1:/home/sbs-onl/comptonDaq/rol/vtpCompton_list.c
then the DAQ runs fine and both the FADC and VETROC data
make sense.

Next I added the VTP.  Still a FP trigger.  It downloads
and prestarts. But here is where the problems start. 

Current Problems

Nov 9, 2022

Current status, globally, is that without the VTP the 
DAQ runs with a front panel trigger at 50 Hz and reads
the FADC and VETROC. Data looks ok. Adding the VTP causes problems.


Problems today

1. There are complaints that I cannot vtpSetCompton_EnableScalerReadout
using firwmare 15.  Probably the least of my problems.

2. Something wrong with VTP Serdes links.  

It takes several seconds to time out.
Waiting on links: PP1 PP2 PP3 PP4 ... (etc)
vtpSerdesCheckLinks: ERROR - all serdes links not up!

3. What library to use ?

vtpEbResetFifo defined in /mnt/SBS/coda/3.10_arm/Linux-armv7l/lib/libvtp.so
but not in /home/sbs-onl/comptonDaq/vtp/libvtp.so
I'm told not to use /mnt/SBS/coda/3.10_arm/Linux-armv7l/lib/

Pulling the libvtp from the SBS HCAL setup, I see that it
is also quite different.  Which one to use ?

Generally, the fact that the readout code I got referred to routines that
are not in my libraries, I assume I must have a mismatch of readout code
and library from the Compton polarimeter.

4. Bus errors for (nearly) any code with the string "Ti" in it.  But not all.

See "Bob1" in the readout list to show the lines that are commented out.

It looks like any code with the string "Ti" in it (presumably tries to talk 
to the TI) causes a bus error.   

5. To USE_DMA or not ?

Different behavior whether I do
#define USE_DMA
or
//#define USE_DMA

Whether I USE_DMA or not ...

With all the lines commented out that causes bus error, 
the DAQ goes into an active state but usually gets no events
i.e. rocTrigger() is not entered.

The DAQ does go through all the transitions without problems.
if those lines are commented out.
Again, see "Bob1" in the readout list.


---------------------------------------------------------------------------------

Analysis Software

Nothing here yet. Work in progress. But there was software for the DAQ used during PREX/CREX.

Old Results