Table of Contents

LNLS 100 MHz ADC RT DAQ

This description including the installation scripts can also be found here:

Git repository

Gateware (FPGA)

The source code can be found in the following Git repository:

fmc-adc-100m14b4cha-gw

A ready to load bitstream can be found here:

bitstream

Software

The source code can be found in the following Git repository:

HALCS

The documentation can be found here:

HALCS documentation

MMC

The MMC code is among other things responsible for routing the correct clocks to the FPGA. The documentation can be found here:

open MMC

Installation at GSI

The installation was successfully tested on a Schroff MTCA-6P-PH8GSI-007 crate equipped with:

Steps to perform

load the bitstream file

load the bitstream file (link above) to the AFC's FPGA using Vivado Hardware Manager

install additional packages

on Centos 7, some additional packages might have to be installed:

1_install_packages.sh

#!/bin/sh

sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install -y git kernel-devel uuid
sudo yum groupinstall -y "Development Tools"

install required libraries

2_install_dependencies.sh

#!/bin/sh

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"

git clone --branch=1.0.8 https://github.com/jedisct1/libsodium.git
git clone --branch=v4.2.5 https://github.com/zeromq/libzmq.git
#git clone --branch=v4.0.2 https://github.com/zeromq/czmq.git # fails with malloc error
git clone https://github.com/zeromq/czmq.git
for project in libsodium libzmq czmq; do
    CONFIG_OPTS=()
    CONFIG_OPTS+=("CFLAGS=-Wno-format-truncation")
    CONFIG_OPTS+=("CPPFLAGS=-Wno-format-truncation")
    #if [ $project == "libzmq" ]; then
    #    CONFIG_OPTS+=("--with-libsodium") # makes libzmq installation fail
    #fi

    cd $project && \
    ./autogen.sh && \
    ./configure "${CONFIG_OPTS[@]}" && \
    make check && \
    make && \
    sudo make install && \
    sudo ldconfig && \
    cd ..

    # Check last command return status
    if [ $? -ne 0 ]; then
        echo "Could not compile/install project $project." >&2
        exit 1
    fi
done

git clone --branch=v1.6.1 https://github.com/lnls-dig/malamute.git && \
for project in malamute; do
    CONFIG_OPTS=()
    CONFIG_OPTS+=("--with-systemd-units")
    CONFIG_OPTS+=("--sysconfdir=/usr/etc")
    CONFIG_OPTS+=("--prefix=/usr")
    CONFIG_OPTS+=("CFLAGS=-Wno-format-truncation")
    CONFIG_OPTS+=("CPPFLAGS=-Wno-format-truncation")

    cd $project && \
    ./autogen.sh && \
    ./configure "${CONFIG_OPTS[@]}" && \
    make check && \
    make && \
    sudo make install && \
    sudo ldconfig && \
    cd ..

    MALAMUTE_VERBOSE=0
    MALAMUTE_PLAIN_AUTH=
    MALAMUTE_AUTH_MECHANISM=null
    MALAMUTE_ENDPOINT='ipc:///tmp/malamute'
    MALAMUTE_CFG_FILE=/usr/etc/malamute/malamute.cfg
    # Install our custom Malamute config file
    sudo sed -i \
        -e "s|verbose\( *\)=.*|verbose\1= ${MALAMUTE_VERBOSE}|g" \
        -e "s|plain\( *\)=.*|plain\1= ${MALAMUTE_PLAIN_AUTH}|g" \
        -e "s|mechanism\( *\)=.*|mechanism\1= ${MALAMUTE_AUTH_MECHANISM}|g" \
        -e "s|tcp://\*:9999|${MALAMUTE_ENDPOINT}|g" \
        ${MALAMUTE_CFG_FILE}


    # Enable service
    sudo systemctl enable malamute || /bin/true

    # Check last command return status
    if [ $? -ne 0 ]; then
        echo "Could not compile/install project $project." >&2
        exit 1
    fi
done

install HALCS

3_install_HALCS.sh

#!/bin/sh

git clone --recursive https://github.com/lnls-dig/halcs && \
cd halcs && \
make && \
sudo make install

install the PCIe driver

test the installation

Functional Testing

No functional tests have taken place yet.