WIB Advanced Operation

WIB Firmware

http://gauss.bu.edu/redmine/projects/dune-wib/wiki/ProtoDUNE_WIB_Firmware

See attachment table for how to load firmware. The DELL DAQ laptop (usually in the Control Room) has the Quartus Programmer already installed.

New ProtoDUNE Software: BUTool

BUTool is the software used to perform interfacing between RCE/FELIX and the WIB. It is a CLI developed by Dan Gastler of Boston University. It takes simple commands (i.e. write, read) to access registers in the WIB, and can be used to display information regarding the WIB and attached FEMBs.

A maintained, user-friendly build is located at /nfs/sw/wib/WIBSoftwareTrunk

To install your own version of BUTool for development, follow the instructions here.

Installing BUTool and WIB Library

You'll need to make sure you have the web proxy setup. Run

~np04daq/bin/web_proxy.sh 

Then checkout the software into, in this case, the WIBSoftwareTrunk directory:

svn co http://gauss.bu.edu/svn/dune-wib.software/trunk WIBSoftwareTrunk

Go into that directory and run

source env.sh
make -j4

to setup and build the code. When you want to use this code, just go into this directory and run source env.sh to setup this version of the software. Run BUTool.exe to test that the install was successful.

Using BUTool

First, cd to the BUTool directory, e.g. /nfs/sw/wib/WIBSoftwareTrunk

Then, activate the environment variables:

$ source env.sh

Determine the IP address for the WIB:

$ arp

This prints out a list of devices on the network:

Address HWtype HWaddress Flags Mask Iface
np04-srv-008.cern.ch ether f0:1f:af:e3:6a:8a C em1
np04-srv-007.cern.ch ether f0:1f:af:e3:61:08 C em1
pddaq-gen01-ctrl0.cern.ch ether 00:1a:a0:16:af:33 C em1
np04-srv-010.cern.ch ether f0:1f:af:e3:68:38 C em1
192.168.200.200 ether d4:c9:ef:2b:ec:40 C em2
192.168.200.50 ether aa:bb:cc:dd:ee:10 C em2
d887-rv4-rbr7y-1-ip13.cern.ch ether 0a:00:10:49:8a:01 C em1
The hardware address of the WIB in this case is aa:bb:cc:dd:ee:10, so the correct IP address is 192.168.200.50

Start BUTool, and connect to the WIB:

$ BUTool.exe -w 192.168.200.50

You are now in the BUTool shell (I'll acknowledge this with using > for commands)

There is a list of commands available in BUToolCommands (put in link for this new page)

Running a command without the necessary arguments will print out the usage

A list of register addresses and text-based aliases can be printed out:

> names *

This will print out all registers, however you can single out a set by including a search term in addition to the wildcard (*) i.e.

> names * < term > *

The output will include the number of registers returned, their names, the register address, and the mask.

You can also print out the registers on the FEMB by executing

> fnames *

Printing out WIB information

The status of the WIB, timing system, and FEMBs can be accessed by running

> status < verbosity >

The level of verbosity determines how much information is displayed

Power Supplied to the FEMBs:

FEMB_PWR FEMB1 FEMB2 FEMB3 FEMB4
EN_1V5 0 0 0 0
EN_2V5 0 0 0 0
EN_2V8 0 0 0 0
EN_3V6 0 0 0 0
EN_BIAS 0 0 0 0
Note: if a FEMB is not a attached, but the signal to turn on power to it has been sent, the column will still read 1.

A description of more info can be found at http://gauss.bu.edu/redmine/projects/dune-wib/wiki/Debug_help

Turning on the FEMBs

> femb_power < FEMB Number >

Note: the FEMB Numbers are indexed from 1 to 4

Turning OFF the FEMBs

cd /nfs/sw/wib/WIBSoftwareTrunk/
source env.sh
BUTool.exe -X scripts/power_off_FEMB_APAX.script

Reading/Writing registers

To read a specific register on the WIB do:

> read < address >

To write:

> write < address > < value >

The FEMBs attached to the WIB can also be written this way by using

> fread < FEMB > < address >

and

> fwrite < FEMB > < address > < value >

Setting Up FEMB Fake Data

See https://twiki.cern.ch/twiki/bin/view/CENF/FEMBFakeData

Setting Up Fake WIB Data

See https://twiki.cern.ch/twiki/bin/view/CENF/WIBFakeData

Running Scripts

Scripts include the same simple commands as one would use in the BUTool shell, and are executed via

> load < script >

A set of pre-written scripts are included in the current build in the scripts/ directory

Initial Setup

To run an initial setup, use

> load scripts/setup.script

Checking WIB Firmware:

To check whether the WIB has the RCE or FELIX firmware and print version information:

> status 1 FW

Manual check firmware versions:

>read 0x101
0x0101: 0x17111001

This is the manually updated firmware version which is YY-MM-DD-## Dan sometimes forgets to update this value.

>read 0x102
0x0102: 0x20171114

Synthesis date YYYY-MM-DD This is automatically updated when Dan runs synthesis, so this will always be up to date.

Configuring FEMBs


 configFEMB          :   Configure an FEMB
                           Usage:
                           configFEMB <iFEMB 1-4> <Gain 0-3> <Shaping Time 0-3> <High Baseline 0-1> <High Leakage 0-1> <Leakage x10 0-1> <AC coupling 0-1> <Buffer 0-1> <Use External Clock 0-1> <Pulser Mode 0-2> <Pulser Amplitude 0-63> [<Clock Phase 0x000-0xFFFF>]

           .--------------------------- FEMB Number 1-4 
           | .------------------------- Gain: 0,1,2,3 for 4.7, 7.8, 14, 25 mV/fC, respectively
           | | .----------------------- Shaping Time: 0,1,2,3 for 0.5, 1, 2, 3 us, respectively
           | | | .--------------------- High Baseline: 0 for 200 mV, 1 for 900 mV, 2 for auto
           | | | | .------------------- High Leakage: 0 for 100 pA, 1 for 500 pA
           | | | | | .----------------- Leakage x10: if 1, multiply leakage times 10    
           | | | | | | .--------------- AC Coupling: 0 for DC coupling, 1 for AC coupling    
           | | | | | | | .------------- Buffer: 0 for disable and bypass, 1 for enable
           | | | | | | | | .----------- Use External Clock 0-1: 0 ADC us internal clock, 1 use FPGA
           | | | | | | | | | .--------- Pulser Mode: 0 off, 1 internal, 2 FPGA (external)
           | | | | | | | | | | .------- Pulser Amplitude: internal 0-63, FPGA 0-31    
           | | | | | | | | | | |    .-- This and following args are ADC FIFO sync phases to try 
           | | | | | | | | | | |    |   
configFEMB 1 2 2 2 1 0 0 0 1 0 0 0xFFFF 0xFDFF 0xEFEF 0xBFBF 0xBDFF

Spy Buffer Usage

WIB to DAQ Spy Buffer

Here is how you set a DAQ link to debug counter mode:

write DAQ_LINK_1.CONTROL.DEBUG_MODE_ENABLE 1

To dump data in this mode type (DAQ Link 1):

spy_daq 1

Example output:

 1866: 1 0x3C
  1867: 1 0x5C
  1868: 1 0x3C
  1869: 1 0x5C
  1870: 1 0x3C
  1871: 1 0x5C
  1872: 1 0xBC
  1873: 0 0x00
  1874: 0 0x01
  1875: 0 0x00
  1876: 0 0x02
  1877: 0 0x00
  1878: 0 0x03
  1879: 0 0x00
  1880: 0 0x04
  1881: 0 0x00
  1882: 0 0x05
  1883: 0 0x00
  1884: 0 0x06
  1885: 0 0x00
  1886: 0 0x07
  1887: 0 0x00
  1888: 0 0x08
  1889: 0 0x00
  1890: 0 0x09
  1891: 0 0x00
  1892: 0 0x0A

FEMB to WIB Spy Buffer

To use the FEMB spy, you need to first select the FEMB link, then arm the spy buffer it, then trigger it, then read the data.

You must arm and trigger again to take more data

Set the stream with

write FEMB_SPY.STREAM_ID <link #>

where FEMB1 link1 is 0, FEMB3 link 1 is 8, etc.

This arms, triggers, and reads out the data:

write FEMB_SPY.ARM 1
write FEMB_SPY.SW_TRIG 1
spy_femb

Example:

>write FEMB_SPY.STREAM_ID 0
FEMB_SPY.STREAM_ID: 0x00000000
>write FEMB_SPY.ARM 1
FEMB_SPY.ARM: 0x00000001
>write FEMB_SPY.SW_TRIG 1
FEMB_SPY.SW_TRIG: 0x00000001
>spy_femb
Recorded 256 samples
  0000: 0 0x1F
  0001: 0 0xFE
  0002: 0 0xE1
  0003: 0 0x1F
  0004: 0 0xFE
  0005: 0 0xE1
  0006: 0 0x1F
  0007: 0 0xFE
  0008: 0 0xE1
  0009: 0 0x1F
  0010: 0 0xFE
  0011: 0 0xE1
  0012: 0 0x1F
  0013: 0 0xFE
  0014: 0 0xE1
  0015: 0 0x1F
  0016: 0 0xFE
  0017: 0 0xE1
  0018: 0 0x1F
  0019: 0 0xFE
  0020: 0 0xE1
  0021: 0 0x1F

KarolH - 2018-06-01

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r8 - 2018-07-27 - KarolH
 
    • 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-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback