How to mask DFBs in the ROMs

This is an attempt to explain how to mask a DFB from the configuration process and from data taking.

You just need to edit the following file and then reboot the ROMs:

/nfs/bbr-srv02/dataflow/ir-2/drc/app/startup.DRC_COMMISSIONER
which looks like this:

# Sector 0
*dfbmasklist = 0xffff;
# Sector 1
*(dfbmasklist+ 4) = 0xffff;
# Sector 2
*(dfbmasklist+ 8) = 0xffff;
# Sector 3
*(dfbmasklist+12) = 0xffff;
# Sector 4
*(dfbmasklist+16) = 0xffff;
# Sector 5
*(dfbmasklist+20) = 0xffff;
# Sector 6
*(dfbmasklist+24) = 0xffff;
# Sector 7
*(dfbmasklist+28) = 0xffff;
# Sector 8
*(dfbmasklist+32) = 0xffff;
# Sector 9
*(dfbmasklist+36) = 0xffff;
# Sector 10
*(dfbmasklist+40) = 0xffff;
# Sector 11
*(dfbmasklist+44) = 0xffff;

In order to mask a DFB you just need to replace the ffff string in the corresponding sector.

DFB numbering in the ROMs

In the DIRC language, the DFBs go from 0 to 13, where DFB #13 is the closest to the DCC. In the following picture we see the 14 DFBs, where the DFB #0 is the first one on the left;
the DCC is located after the last DFB on the right, outside the picture.

In the ROMs, the DFBs are numbered in the opposite direction, where 0 corresponds to the DFB closest to the DCC.

So the DIRC and DataFlow schemes are:
DIRC 0 1 2 3 4 5 6 7 8 9 10 11 12 13 DCC
Dataflow 13 12 11 10 9 8 7 6 5 4 3 2 1 0 DCC

Now we have to translate this into hexadecimal language.
Instead of going into explanations of hex and binary languages, let us just explain a method to count and figure out which bit we have to change to mask a DFB.

This is the configuration when all DFBs are active
Hex f f f f
Bin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
DFB (DataFlow) 13 12 11 10 9 8 7 6 5 4 3 2 1 0

When we want to mask a DFB, we need to set to 0 the corresponding bit in the binary
representation and then translate it in hexadecimal represantation, for instance:
if we want to mask DFB #10 (in DIRC convention) in sector 5, we apply the following procedure:

  1. Translate the DFB number in DataFlow scheme:
    by looking at the first table, DFB #10 becomes DFB #4;
  2. change the corresponding 1 into a 0 in the binary representation;
  3. Bin 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1
    DFB (DataFlow) 13 12 11 10 9 8 7 6 5 4 3 2 1 0
    which becomes 1011;

  4. Use the following table to convert the binary number in hexadecimal
  5. Hex Bin Dec
    0 0000 0
    1 0001 1
    2 0010 2
    3 0011 3
    4 0100 4
    5 0101 5
    6 0110 6
    7 0111 7
    8 1000 8
    9 1001 9
    a 1010 10
    b 1011 11
    c 1100 12
    d 1101 13
    e 1110 14
    f 1111 15
    we see that the bit 1011 becomes b in hexadecimal language1 ;

  6. We now need to save the current DFB masking file:

    /nfs/bbr-srv02/dataflow/ir-2/drc/app > cp startup.DRC_COMMISSIONER startup.DRC_COMMISSIONER_YYYYMMDD

  7. at this point we can change the corresponding line in startup.DRC_COMMISSIONER:

    # Sector 5
    *(dfbmasklist+20) = 0xffbf;

  8. Watch out, the actual masking file is called startup, which should become the link to your new file

    /nfs/bbr-srv02/dataflow/ir-2/drc/app > ls -l startup
    lrwxrwxrwx 1 babardrc bfactory 21 Mar 2 17:58 startup -> startup.DRC_COMMISSIONER

  9. at this point you just need to reboot the ROMs.

1Yes, this is the guide for stupid people


Emmanuele Salvati
Last modified: Fri Apr 20 15:19:39 PDT 2007