WIB Development

Software To-Do

  • Make FELIX DAQ link start/stop time configurable
  • Get the FEMB ADCs to sync more reliably
  • Make a new calibration mode in the boardreader that cycles through pulser amplitudes or phases
  • Boardreader add configurable option to power down all FEMBs that aren't currently configured
  • WIB DIM Server: make keep trying all WIBs, even if they aren't up
  • Fix WIB/FEMB address tables so that pretty printing (e.g. 14 mV/fC instead of 0x1) goes to both DIM and BUTool status
  • Finish working on WIB HTML Monitoring: bring to public Internet
  • Make WIB class (and dependencies) have configurable verbosity--a class variable so that it is set once before running all of the commands
  • Make WIB class (and dependencies) have configurable output stream so that message logger can somehow be used without making it a dependency

Firmware To-Do

  • From RCE: have a mode to duplicate FEMB 1 & 2 data onto the 3 & 4 links to test compression (they can compress half and compare to uncompressed). Link will still have it's own fiber ID
  • Port Jack's ping code to the BU firmware
  • Get UDP data streaming working

artDAQ Message Logger Parser

This is my regexp that parses the %MSG header for each MSG entry:

grok { #In order to match something like this:

# -d BoardReader: BoardReader -epdtdi04-5205 04-May-2017 17:38:50 CEST MF-online actual message...

match => { "message" => "\A%{SPACE}-%{WORD:severity}%{SPACE}%{NOTSPACE:function}:%{SPACE}%{NOTSPACE:processId}%{SPACE}%{NOTSPACE:date}%{SPACE}%{TIME:time}%{SPACE}%{WORD:timezone}%{SPACE}%{NOTSPACE:context}%{SPACE}%{GREEDYDATA:msg}" } }

I remove newlines and "%MSG" tokens, then I parse the log entry as a single string. To know, which field is what, to be searchable on Kibana, I need to ensure that the first X tokens exits for every entry. That's why this passes:

i dune::FelixHardwareInterface::FelixHardwareInterface: Early 15-May-2018 13:25:52 CEST pre-events Setting up NetioHandler (host, port, adding channels, starting subscribers, locking subs to CPUs.)

And this does not:

i WIB Early 17-May-2018 15:52:47 CEST pre-events Configured WIB

(You have 2 tokens before "Early" -that is matched as "processId" in the regexp-) (edited)

Vertical Slice Test stand (VST)


  • Support at least 2 WIBs, one for RCE readout and one for FELIX readout. (done)
    • Attach 4 CE boxes to each WIB.
    • Receive timing and power from PTC. (done)
  • Firmware
    • Load firmware from Linux. (done)
    • USB blaster for each WIB. (done)
    • Progam sof files. (done)
    • Load jic file on flash.
  • Configuration scripts
    • Configure RCE WIB. (done, changing ...)
    • Configure FELIX WIB. (done, changing ...)
  • ARTDAQ board reader (In progress)
  • Add VST to DAQ run control (In progress)
  • Fake data generated in WIB that emulates data from FEMB.
  • Debugging tools
    • WIB side (done)
    • RCE side (done)

WIB ARTDAQ Development

Setting up a WIB Development Environment

First, get access to np04-srv-009 and np04-srv-010. Request access to the np-comp CERN Linux group, and then ask Geoff Savage for access. You can login to the np04 servers from lxplus.

Login to np04-srv-009 or np04-srv-010 and put these lines in your .bashrc

export http_proxy=<address>:<port>
export https_proxy=<address>:<port>
export WIBIP=

Then logout and back in.

Then create a file .subversion/servers with the following lines:

http-proxy-host = <address like in .bashrc>
http-proxy-port = <port like in .bashrc>

buserver = gauss.bu.edu

username = <your username on the BU SVN server if you have one, otherwise doesn't matter>

Now you are ready to download the software. Create an artDAQ directory in your home area and cd into it. Then run (taken from here):

wget https://cdcvs.fnal.gov/redmine/projects/dune-artdaq/repository/revisions/develop/raw/tools/quick-mrb-start.sh
chmod +x quick-mrb-start.sh
./quick-mrb-start.sh --wib-installation-dir /nfs/sw/artdaq/dune-wib --uhal-products-dir /nfs/sw/artdaq/products --dune-raw-data-develop-branch  --not-dune-artdaq-developer

On a new login, use cd to your artDAQ directory and source setupDUNEARTDAQ to setup your artDAQ.

Next, download and install the WIB software in your home directory:

svn co http://gauss.bu.edu/svn/dune-wib.software/trunk WIBSoftwareTrunk
cd WIBSoftwareTrunk
source env.sh
make -j8

On a new login, you will need to go into that directory and source env.sh again to use the BUTool.exe.

Now, you need to go back and recompile artDAQ to use your development version of the WIB software. Change the export WIB_DIRECTORY line in /setupDUNEARTDAQ to point to ~/WIBSoftwareTrunk

Then go into the artDAQ directory and run mrb z and then mrb i -j8 to recompile your artDAQ to link your development version of the WIB software.

Everything should work now. The WIB files in artdaq are the two files /srcs/dune_artdaq/dune-artdaq/Generators/WIBReader*

Running the WIBReader Configure Step

Copy this file to your local directory:


Run it with:

artdaqDriver -c WIB.fcl

Setting up git for pushing commits

You have to setup a git repository on lxplus and use it to commit to fermilab.

On lxplus, you first have to be able to kerberos authenticate. Run:

kinit -A < your fnal username >@FNAL.GOV

Then, in whatever directory on lxplus you want the code to be in:

git clone ssh://p-dune-artdaq@cdcvs.fnal.gov/cvs/projects/dune-artdaq

Now, in the dune-artdaq repository in the srcs dir of your artdaq directory on np04 run:

git remote add lxplus ssh://lxplus/< full path to the repository you created on lxplus >

Finally, you can push a branch from np04 to lxplus by typing:

git push lxplus < branch name >

and push the branch from lxplus to the fermilab redmine git repo with:

git push origin < branch name >

Adding New Commands to BUTool

At the lowest level, BUTool works by setting bits of addresses in the WIB/attached FEMBs. Write and Read methods of the WIB class are called by other methods for this same class. These WIB methods are then called by the WIBDevice class, which is called by mapped BUTool command. The flow for implementing new commands for BUTool is illustrated as such:



As an example, let's say we want to write a function that writes the following registers as such:





sleep 1

#reset the PDTS command counters



#disable the convert generators



We have to start with implementing a WIB method (let's call it ResetWIB) that calls the Write method for these specific registers. For robustness, let's give the ability to choose which of the Reset bits to set.

In WIB/src/WIB/WIB.cc (we could also choose a different file in the WIB/src/WIB/ directory) we'll add the definition as such:

void WIB::ResetWIB(bool cntrlRegister, bool global, bool i2c, bool udp){

//run resets

Write("SYSTEM.RESET.CONTROL_REGISTER_RESET", uint8_t(cntrlRegister));

Write("SYSTEM.RESET.GLOBAL_RESET", uint8_t(global));

Write("SYSTEM.RESET.I2C_RESET", uint8_t(i2c));

Write("SYSTEM.RESET.UDP_RESET", uint8_t(udp));


//Set clock settings



//Halt signals



Let's not forget to add the declaration in WIB/include/WIB/WIB.hh and we'll add in defaults for the options.

void ResetWIB (bool cntrlRegister=true, bool global=false, bool i2c=false, bool udp=false);

At this point, let's go ahead and run '$ make 'to check we did this right.

We can now work on calling this WIB method in a WIBDevice method, which will be what BUTool utilizes in its running.

Let's refrain from using WIBDevice.c for these methods, that's what we'll use to map commands later. In tool/src/wib_device/WIBDevice_init.c let's add:

CommandReturn::status BUTool::WIBDevice::ResetWIB(std::vector strArg, std::vector<uint64_t> intArg){

(void) strArg;

if(intArg.size() > 4){

return CommandReturn::BAD_ARGS; }

else if(intArg.size()==4){

wib->ResetWIB(bool(intArg[0]), bool(intArg[1]), bool(intArg[2]), bool(intArg[3])); }

else if(intArg.size()==3){

wib->ResetWIB(bool(intArg[0]), bool(intArg[1]), bool(intArg[2])); }

else if(intArg.size()==2){

wib->ResetWIB(bool(intArg[0]), bool(intArg[1])); }

else if(intArg.size()==1){

wib->ResetWIB(bool(intArg[0])); }


wib->ResetWIB(); }

return CommandReturn::OK; }

And we'll also add the declaration in tool/include/wib_device/WIBDevice.hh

CommandReturn::status ResetWIB (std::vector,std::vector<uint64_t> intArg);

Now all we have to do is map the command so BUTool can call it, and we'll include its Usage note. The Usage note is displayed whenever the BAD_ARGS status is returned in the above method.


"Reset the WIB.\n" \

"  Usage:\n" \

"  resetWIB \n");

We can now '$ make' and try to use it in BUTool.exe

-- JustinHugon1 - 2018-08-01

Edit | Attach | Watch | Print version | History: r27 < r26 < r25 < r24 < r23 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r27 - 2018-08-14 - JustinHugon1
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CENF All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback