Using the MOLLERADC with CODA

Table of Contents

1. Firmware and OS Installation

1.1. Downloads

1.1.1. molleradc-distirbution

Download options

  1. clone with git
    git clone --branch rev2 --depth 1 https://code.jlab.org/fedaq/fw/molleradc-distribution.git
    
  2. Use one of the other gitlab download options

    Code ˇ pulldown menu : zip, tar, …

    https://code.jlab.org/fedaq/fw/molleradc-distribution

1.1.2. CentOS7 Distribution for MOLLERADC

Choose if the root filesystem will reside on an NFS server, or on a local disk (microSD or onboard eMMC)

  1. diskless
  2. local disk
    • root filesystem (tgz)

1.2. Installation

1.2.1. Diskless

1.2.2. microSD

Determine which device was recognized as the microSD. The script, by default, will use

SD_DEV=/dev/sda

Update the variable SD_DEV in the makeSD.sh script to match the device used by your linux system.

Execute the script as root to write the boot files to the microSD

cd molleradc-distribution
sudo ./makeSD.sh

1.2.3. eMMC

The script must be executed on an MOLLERADC that is already booted with microSD or Diskless OS.

Execute the script as root to write the boot files to the eMMC

cd molleradc-distribution
sudo ./makeMMC.sh

1.3. Update boot targets

From a connected terminal using the USB-B connection on the front panel, modify the uboot environment by interrupting the boot process just after power-up.

The prompt will look like:

Hit any key to stop autoboot

Update the boot targets (for example, check PXE, then eMMC, then SD for boot images):

env set boot_targets "pxe mmc0 mmc1"
env save

2. Software Configuration

2.1. CODA environment and configuration

2.1.1. EXPID

The CODA environment variable EXPID is defined in

/home/coda/coda_setup.sh

The coda_roc will need to be restarted if it is changed. By default,

EXPID=daqlab

2.1.2. ROC name

by default, the name used for the MOLLERADC CODA ROC component is it's hostname. For example,

hostname = damolleradc1.jlab.org
CODA ROC name = damolleradc1

the hostname and CODA ROC name defintions are done in

/home/coda/bin/startRoc.sh ->
     /usr/local/coda/3.10_arm/systemd/procServ_coda_roc.sh

2.2. Run Configuration files and Readout Lists

2.2.1. Streaming Mode

/home/coda/cfg/molleradc-stream.cfg
/home/coda/rol/molleradc_stream_list.so

2.2.2. TI Triggered

/home/coda/cfg/molleradc.cfg
/home/coda/rol/molleradc_list.so

2.3. Restart / Reboot

For the first two solutions, use ssh to connect remotely. For example

ssh coda@damolleradc1.jlab.org

2.3.1. coda_roc

  • restart with systemd

    sudo systemctl restart coda_roc
    
  • restart with killall command

    killall -9 coda_roc
    
  • restart with Control-X in procServ terminal
    • connect with

      connectRoc.sh
      

2.3.2. soft reboot

sudo reboot

2.3.3. front panel TTL signal

2.4. jcedit examples

2.4.1. Streaming Mode

Run Type Configuration

molleradc_jcedit_streaming0.png

MOLLERADC ROC Component

molleradc_jcedit_streaming1.png

2.4.2. TI Triggered

Run Type Configuration

molleradc_jcedit0.png

MOLLERADC ROC Component

molleradc_jcedit1.png

2.5. Readout

2.5.1. Streaming Mode example evio event

<!-- ===================== Buffer 3 contains 16398 words (65592 bytes) ===================== -->

   <!-- header words: 16397, 0xff501001 -->
   <event format="evio" count="3" content="bank" data_type="0x10" tag="65360" padding="0" num="1" length="16397" ndata="16396">

      <!-- header words: 7, 0xff202001 -->
      <bank content="segment" data_type="0x20" tag="65312" padding="0" num="1" length="7" ndata="6">

         <!-- header word: 0x10a0002 -->
         <uint64 data_type="0xa" tag="1" padding="0" length="2" ndata="1">
            0x0000000000000001  
         </uint64>

         <!-- header word: 0x1850001 -->
         <uint16 data_type="0x5" tag="1" padding="2" length="1" ndata="1">
            0x00fe  
         </uint16>

         <!-- header word: 0x18010000 -->
         <uint32 data_type="0x1" tag="24" padding="0" length="0" ndata="0">
         </uint32>
      </bank>

      <!-- header words: 16387, 0x181001 -->
      <bank content="bank" data_type="0x10" tag="24" padding="0" num="1" length="16387" ndata="16386">

         <!-- header words: 16385, 0x4d0a01 -->
         <uint64 data_type="0xa" tag="77" padding="0" num="1" length="16385" ndata="8192">
            0xff1f0600000000dd  0xc9d814a007000000  
            0x4040fcff41c0ffff  0x4000fdff4100ffff  
            0x4080fcff41c0ffff  0x40c0fcff4100ffff  

2.5.2. TI Triggered Mode example event

<!-- ===================== Buffer 3 contains 29 words (116 bytes) ===================== -->

   <!-- header words: 28, 0xff501001 -->
   <event format="evio" count="3" content="bank" data_type="0x10" tag="65360" padding="0" num="1" length="28" ndata="27">

      <!-- header words: 16, 0xff212002 -->
      <bank content="segment" data_type="0x20" tag="65313" padding="0" num="2" length="16" ndata="15">

         <!-- header word: 0x10a0004 -->
         <uint64 data_type="0xa" tag="1" padding="0" length="4" ndata="2">
            0x0000000000000001  0x000000009a077eff  
         </uint64>

         <!-- header word: 0x1850001 -->
         <uint16 data_type="0x5" tag="1" padding="2" length="1" ndata="1">
            0x000a  
         </uint16>

         <!-- header word: 0x12010003 -->
         <uint32 data_type="0x1" tag="18" padding="0" length="3" ndata="3">
            0x9a077eff  0x09c00000  0xda560000  
         </uint32>

         <!-- header word: 0x18010003 -->
         <uint32 data_type="0x1" tag="24" padding="0" length="3" ndata="3">
            0x9a077eff  0x09c00000  0xda560000  
         </uint32>
      </bank>

      <!-- header words: 7, 0x121001 -->
      <bank content="bank" data_type="0x10" tag="18" padding="0" num="1" length="7" ndata="6">

         <!-- header words: 5, 0x50101 -->
         <uint32 data_type="0x1" tag="5" padding="0" num="1" length="5" ndata="4">
            0x01000000  0xadde0000  0x11f1bace  0x22f2bace  
         </uint32>
      </bank>

      <!-- header words: 1, 0x181001 -->
      <bank content="bank" data_type="0x10" tag="24" padding="0" num="1" length="1" ndata="0">
      </bank>
   </event>

   <!-- end buffer 3 -->

3. MOLLERADC Software

3.1. Directory Structure

/home/coda/
      |
      ├── bin/
      |   ├── connectRoc.sh
      |   ├── startRoc.sh
      |
      ├── cfg/
      |   ├── molleradc.cfg
      |   ├── molleradc-stream.cfg
      |
      ├── rol/ -> /home/coda/src/molleradc/rol/
      |   ├── CODA Readout lists (softlink to library rol/)
      |
      ├── lib/
      |   ├── Software Libraries for CODA (molleradc, dalma)
      |
      ├── include/
      |   ├── Software Headers for compiling readout lists / libraries
      |
      ├── src/
          ├── Source code for installed libraries
          

3.2. MOLLERADC Library

3.3. moller Service

3.4. CODA ROC

3.4.1. CODA installation

The MOLLERADC uses a CODA installation at

CODA=/usr/local/coda/3.10_arm

Despite the name, this CODA verison is compiled for aarch64.

3.4.2. systemd + procServ

The coda_roc program is executed with procServ as a systemd service

/usr/local/coda/3.10_arm/systemd/coda_roc.service

This service is enabled to start at boot, and should restart automatically if killed.

procServ executes the coda_roc through the shell script

/usr/local/coda/3.10_arm/systemd/procServ_coda_roc.sh

3.4.3. ROC terminal access

It is not necessary to be connected to the MOLLERADC ROC terminal for CODA operation. Though, it may be useful to monitor it's output. Access to the coda_roc prompt and output is through a local telnet port 20000 (hosted by procServ)

telnet localhost 20000

or with the shell script

connectRoc.sh

3.5. Streaming Mode decoder

Here's a quick EVIO decoder made to emulate that from Michael Gerieke's MOLLERADC readout software:

coda3-decoder : molleradc_streaming branch

4. This Document

4.1. org-file

Author: Bryan Moffit <moffit@jlab.org>

Created: 2025-08-27 Wed 12:35

Validate