NUstar ReaDout LIBrary - Nurdlib

The definite library for readout of data collection modules commonly used in nuclear physics experiments. Made in Germany.

Example Config

# Name and crate ID
CRATE("VME0")
{
        # Use multi-event readout
        multi_event = true
        # Type + address
        GSI_TRIDI(0x02000000) {}
        CAEN_V775(0x00010000)
        {
                common_start = true
                time_range = 1200 ns
        }
}

Installation

The short version for the impatient:

Install htools:

hg clone https://hg.osdn.jp/view/htools/htools
make -C htools
export HTOOLS_PATH=`pwd`/htools

Install Nurdlib:

git clone lx-pool.gsi.de:/u/htoernqv/repos/nurdlib.git
cd nurdlib
export NURDLIB_DEF_PATH=`pwd`/cfg/default
make

To run all tests:

make test

Overview

_images/nurdlib.png

Features

  • ASCII-based configuration of readout
  • Sane default configuration for modules
  • Logging and debugging facilities
  • Simple API striving for safe usage
  • DAQ framework and platform independence
  • Generic module groups for separated read-out
  • Simple online module tests
  • Online data integrity checking
  • Multi-event support
  • Static and dynamic mapping of memory
  • Single cycle and block transfer
  • TRLO II support
  • Strict ANSI C compliance and harsh GCC flags
  • Offline unit testing with coverage report
  • Code unificiation and readability has high priority
  • Command line monitoring and configuration tool
  • External memory access and testing tools

Supported modules

  • CAEN
    • v775, v785, v792, v820, v830, v895, v965, v1190, v1290
  • GSI
    • febex, sam, tacquila, tamex 2(+PADI) & 3 tridi(trlo2), triva, vetar, vftx2, vulom(trlo2), vuprom(TDC)
  • Mesytec
    • madc32, mqdc32, mtdc32
  • PNPI - cros3
  • Struck SIS - sis3316
  • Dummy module for testing
  • anything we can get our hands on

Building Nurdlib

The Nurdlib build system is based on non-recursive GNU makefiles and makes extensive use of the htools library. All generated files are placed inside Nurdlib in a directory of the form:

build_<gcc machine>_<gcc version>_<build mode>/

including the static library libnurdlib.a. Link your DAQ binary with this library and you’re done. Note that the somewhat complicated build directory name eliminates all collisions between several builds across platforms and build modes.

Testing coverage

Coverage analysis of testing is done with gcov. All code involved in building and linking the tested code needs to be built with special GCC flags which makes the binaries very slow. htools/htest will properly flush gcov results htools/hgmake will provide Nurdlib with the necessary compilation and linking flags. Nurdlib also has three coverage specific build targets to report the results after the test target has been invoked at least once:

  • gcov - Small summary of the full test.
  • gcov_files - File-level report (gcov -n).
  • gcov_funcs - Function-level report (gcov -fn).

Build in gcov mode:

make BUILD_MODE=gcov test
make BUILD_MODE=gcov gcov
make BUILD_MODE=gcov gcov_files
make BUILD_MODE=gcov gcov_funcs

Release mode

When you are done debugging, build in release mode:

make BUILD_MODE=release

Build for shared library use

To be used as a shared object, the additional -fPIC compile flag is needed. This usually may have a performance impact and is therefore disabled by default. The fpic build mode enables this flag:

make BUILD_MODE=fpic

Utils

Inspect a running Nurdlib:

./bin/nurdctrl --crates
./bin/nurdctrl --crate=0 --crate-info
./bin/nurdctrl --crate=0 --module=2 --register-dump

Dump the read/write module registers directly:

./bin/rwdump -a 0x02000000 -r 32

Online read/write with nurdctrl is not implemented to reduce the risk of locking up a running DAQ (there are enough lurking dangers for a DAQ).

Development status

We believe in community support and openness when developing this library, and therefore publish an updated development status regularly right here!

People

Haik Simon, Håkan T. Johansson, Alexandre Charpy, Bastian Löher, Michael Munch, Hans Törnqvist

References

Old documentation is here.