Difference: RichPdmdbModuleTesting (1 vs. 17)

Revision 172019-08-13 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 6 to 6
  Web pages are under development which wil provide summaries of the test results. They are likely to change without warning and are not likely to contain meaningful data at present.
Changed:
<
<
A directory can be found here.
>
>
A directory can be found here.
 

Hardware Installation

Revision 162019-04-09 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 28 to 28
 

Master link I2C

Changed:
<
<
Production boards are delivered to the test facility without the e-fuses being set. Therefore initial configuration of the master GBTX requires an I2C interface. MuDaq can operate as an I2C master. The physical I2C link will be through an adapter that plugs into JP5 ("GBT Dongle") of the module tester board. This adapter also provides the hardware required to program the master GBTX e-fuses. The adapter is connected to the muDaq using a short flat ribbon cable.
>
>
Production boards are delivered to the test facility without the e-fuses being set. Therefore initial configuration of the master GBTX requires an I2C interface. MuDaq can operate as an I2C master. The physical I2C link will be through an adapter that plugs into JP5 ("GBT Dongle") of the module tester board. This adapter also provides the hardware required to program the master GBTX e-fuses. The adapter is connected to the muDaq using a short flat ribbon cable. The connector pin assignments are documented in the RichMuDaq topic.
 
Changed:
<
<
SK4 Pin FPGA IO Signal
1   NC
2   3V3
3   GND
4 F20 EFUSEPROG
5 E21 SDA
6 D21 EFUSEPWREN
7 C21 SCL
8 B21  

Data links

MuDaq has 8 SFP ports. They are numbered differently on the PCB than in the firmware/software. They are used as follows:

PCB legend FPGA MGT RX usage TX usage
SFP8 0 TCM.TX TCM.RX
SFP7 1 Unused Unused
SFP6 2 DTM0.GBTX0.TX Unused
SFP5 3 DTM0.GBTX1.TX Unused
SFP4 4 DTM1.GBTX0.TX Unused
SFP3 5 DTM1.GBTX1.TX Unused
SFP2 6 DTM2.GBTX0.TX Unused
SFP1 7 DTM2.GBTX1.TX Unused
>
>

Optical links

MuDaq has 8 SFP ports. They are numbered differently on the PCB than in the firmware/software. The SFP usage is documented in the RichMuDaq topic.

 

Software Installation

Revision 152019-04-09 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 71 to 71
 

Setting up

Changed:
<
<
The GUI must be run on the PC to which the muDaq USB is connected but this can be different to the microcontroller host PC since the Java to microcontroller host connection uses a network socket. The address of the network socket can be set from the Main menu. Select Set MTB socket... and enter the network address in URL notation. If your GUI and microcontroller host are the same, you can use http://:7999 as the network address. More generally, if the machines are different, you can use http://host.domain:7999 instead, where host.domain is the IP address of the micrcontroller host. If you change the setting, you should restart the Java GUI to open a new connection.

The program configures itself from cached XML files which are automatically updated from the Cambridge website every time the program is started and which are located in the execution directory and have prefix www-. Therefore the PC must be connected to the network the first time the GUI is run. Since these cached files would be overwritten every time the program starts it is recommended that the cached XML files are renamed to remove the www- prefix. The GUI will then use these files and not connect to the network. These files can then be customised if needed and will never be overwritten.

>
>
See also RichMuDaq#Quick_start_guide
  The microcontroller host Linux system must be prepared first to accept the network connections from the Java GUI.
Line: 112 to 110
  You may need to choose the GBTX configuration files for correct operation. For the module testing, TCM.VCXO.gbt can be used for the TCM GBTX and DTM-noXPLL.gbt for all 6 DTM GBTXs. The TCM file should be set in the Master GBTX I2C... and Master GBTX IC... panels and the DTM file can be set in the Master link... panel.
Deleted:
<
<

Test sequence XML

The test sequence is defined in XML. An example XML fragment is given below.

  <command label="muDAQ configure" targetClass="MuDaq" targetMethod="configure"/>
  <command label="muDAQ configure master link" targetClass="MuDaq" targetMethod="configureMasterLink"/>
  <command label="SCA setup" targetClass="ScaControl" targetMethod="setup"/>
  <command label="SCA set DACs" targetClass="ScaControl" targetMethod="setDac" data="0|33?1|127?2|75?3|92"/>
  <command label="SCA set GPIO[7:1]" targetClass="ScaControl" targetMethod="setGpio" data="7|1"/>
  <command label="MTB NOP" targetClass="PdmdbModuleTester" targetMethod="exec" data="NOP">
    <response opcode="ACK_OK" timeout="500" incrementSequenceNumber="true"/>
  </command>
  <command label="MTB measure power" targetClass="PdmdbModuleTester" targetMethod="exec" data="MEASURE_POWER|1111">
    <response opcode="ACK_OK" timeout="500" incrementSequenceNumber="true"/>
    <response opcode="MEASURE_POWER" timeout="3000"/>
  </command>
  <command label="Do analysis" targetClass="Command" targetMethod="shell" data="/lhcb/lhcbrich/Upgrade/PDMDBTesting/PDMDBKIT/doAnalysis.sh|arg1"/>

The commands reference static methods in the various Java GUI classes. The class (relative to cbsw.lhcb.pdmdb) is given in the targetClass attribute and the method in the targetMethod attribute. The fully-qualified target method signature is then

public static String cbsw.lhcb.pdmdb.targetClass.targetMethod(String [])

Any new methods that are added must conform to this signature. The String[] argument contains the tokenised target method data split at the | characters. The returned String starts with mandatory OK or FAIL text followed by | and any optional data.

For example. the tester MEASURE_POWER command results in a call

public static String cbsw.lhcb.pdmdb.PdmdbModuleTester.exec({"MEASURE_POWER","1111"})

Commands are executed in the order they are given in the XML. Where the commands target the test board, the GUI waits for each of the listed responses before proceeding. A timeout in milliseconds can be applied to the tester responses. The GUI will abort the sequence when a timeout occurs or when an unexpected response is received.

The label attribute is used as the test button label on the tester sequence panel.

If the same command needs to be executed several times by the same target method this can be done by concatenating the target method data using the ? character as separator. See, for example, the setDac method in the XML above.

The incrementSequenceNumber="true" attribute should normally appear on the first response of each command. However, under some circumstances, responses after the initial ACK_OK may be handled in the response list of the next command. In this case the attribute should not appear on the deferred response.

The cbsw.lhcb.pdmdb.Command.shell() method allows to run a shell script as part of the sequence. The Do analysis command in the above xml fragment is an example of this. The shell script must follow certain rules relating to IO redirection so some care is needed in preparing it.

 

Python software

The Python software forms the interface between the Java muDAQ software and the microcontroller firmware. It is made up of four files (modules).

Line: 179 to 139
 <path-to-java11-installation>/bin/java @JPDMDBDepp.opts
Deleted:
<
<

GUI interactions

The Play button executes the whole sequence from the beginning. The Pause button flags the sequence to stop at the next opportunity. Resume will continue from where the sequence paused.

Step executes the commands consecutively one at a time on each click. First step resets to the beginning of the sequence and executes the first command. Resume can be used in step mode to continue automatically from the last executed command.

Individual commands may be executed by clicking the corresponding button. However, this does not change the current position in the sequence as used by Step and Resume. This is a convenient way of retrying a failed command.

In case the GUI aborts a transaction, it may be necessary to empty the response FIFO. A Read flush button is provided on the tester sequence panel to do this. It reads the FIFO in a loop until a timeout occurs indicating that the FIFO is empty. After this a NOP instruction should be sent to synchronise with the tester.

 

The testing process

It is best to leave MuDaq always powered but the TCM and DTM power must be off when mounting and dismounting the plug-ins. The test sequence should do this automatically but it is important to check.

Revision 142019-01-14 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Added:
>
>

Test data

Web pages are under development which wil provide summaries of the test results. They are likely to change without warning and are not likely to contain meaningful data at present.

A directory can be found here.

 

Hardware Installation

Module tester board

Revision 132019-01-09 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 161 to 161
  On Linux:
Changed:
<
<
cd /lhcb/lhcbrich/Upgrade/PDMTBTesting/PDMDBKIT/
>
>
cd /lhcb/lhcbrich/Upgrade/PDMDBTesting/PDMDBKIT/
  On Windows (Cygwin)
Changed:
<
<
cd /cygdrive/q/lhcb/lhcbrich/Upgrade/PDMTBTesting/PDMDBKIT/
>
>
cd /cygdrive/q/lhcb/lhcbrich/Upgrade/PDMDBTesting/PDMDBKIT/
  Then

Revision 122018-12-20 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 65 to 65
 

Setting up

Changed:
<
<
The GUI must be run on the PC to which the muDaq USB is connected but this can be different to the microcontroller host PC since the Java to microcontroller host connection uses a network socket.
>
>
The GUI must be run on the PC to which the muDaq USB is connected but this can be different to the microcontroller host PC since the Java to microcontroller host connection uses a network socket. The address of the network socket can be set from the Main menu. Select Set MTB socket... and enter the network address in URL notation. If your GUI and microcontroller host are the same, you can use http://:7999 as the network address. More generally, if the machines are different, you can use http://host.domain:7999 instead, where host.domain is the IP address of the micrcontroller host. If you change the setting, you should restart the Java GUI to open a new connection.
  The program configures itself from cached XML files which are automatically updated from the Cambridge website every time the program is started and which are located in the execution directory and have prefix www-. Therefore the PC must be connected to the network the first time the GUI is run. Since these cached files would be overwritten every time the program starts it is recommended that the cached XML files are renamed to remove the www- prefix. The GUI will then use these files and not connect to the network. These files can then be customised if needed and will never be overwritten.
Line: 102 to 102
  This program manages the network connection between the tester and the GUI and must always be running. The window may contain useful debug output.
Added:
>
>

GBTX configuration files

You may need to choose the GBTX configuration files for correct operation. For the module testing, TCM.VCXO.gbt can be used for the TCM GBTX and DTM-noXPLL.gbt for all 6 DTM GBTXs. The TCM file should be set in the Master GBTX I2C... and Master GBTX IC... panels and the DTM file can be set in the Master link... panel.

 

Test sequence XML

The test sequence is defined in XML. An example XML fragment is given below.

Revision 112018-12-18 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 56 to 56
  here. Unpack into your installation directory. Some files will require local customisations:
Added:
>
>
PDMDBKIT/testerSequence.xml
 PDMDBKIT/doAnalysis.sh PDMDBKIT/ncat-daemon.sh
Line: 116 to 117
 
Changed:
<
<
>
>
  The commands reference static methods in the various Java GUI classes. The class (relative to cbsw.lhcb.pdmdb) is given in the targetClass attribute and the method in the targetMethod attribute. The fully-qualified target method signature is then
public static String cbsw.lhcb.pdmdb.targetClass.targetMethod(String [])
Line: 134 to 137
  The incrementSequenceNumber="true" attribute should normally appear on the first response of each command. However, under some circumstances, responses after the initial ACK_OK may be handled in the response list of the next command. In this case the attribute should not appear on the deferred response.
Added:
>
>
The cbsw.lhcb.pdmdb.Command.shell() method allows to run a shell script as part of the sequence. The Do analysis command in the above xml fragment is an example of this. The shell script must follow certain rules relating to IO redirection so some care is needed in preparing it.
 

Python software

Changed:
<
<
The Python software forms the interface between the Java MuDAQ software and the microcontroller firmware. It is made up of four files (modules).
>
>
The Python software forms the interface between the Java muDAQ software and the microcontroller firmware. It is made up of four files (modules).
 
  1. serial_interface.py provides methods for communicating with the microcontroller firmware, particularly checking for responses and errors. You should not need to run or modify this file, although it must be present.
Changed:
<
<
  1. udaq_interface.py provides methods for communicating with the MuDAQ firmware, particularly checking for responses and errors. You should not need to run or modify this file, although it must be present.
>
>
  1. udaq_interface.py provides methods for communicating with the muDAQ firmware, particularly checking for responses and errors. You should not need to run or modify this file, although it must be present.
 
  1. module_test_functions.py provides functions for running each test on the microcontroller. You may need to change the name of the microcontroller serial port on line 13 of this file, depending on your system configuration, but you should not need to run it directly.
Changed:
<
<
  1. test_supervisor.py is a process that waits for commands from the MuDAQ, then runs the appropriate test on the microcontroller and returns the result to the MuDAQ. You need to have this program running for the communication between the MuDAQ and microcontroller to work. A summary of messages sent and received will be printed to the terminal it it running in. You may need to change the name of the microcontroller serial port on line 20 of this file, or the pipe names on line 19 (depending on your system configuration). This should be the only file you need to run directly (see below).
>
>
  1. test_supervisor.py is a process that waits for commands from the muDAQ, then runs the appropriate test on the microcontroller and returns the result to the muDAQ. You need to have this program running for the communication between the muDAQ and microcontroller to work. A summary of messages sent and received will be printed to the terminal it it running in. You may need to change the name of the microcontroller serial port on line 20 of this file, or the pipe names on line 19 (depending on your system configuration). This should be the only file you need to run directly (see below).
 The software is written for Python 3.6. It will not work with Python 2.x.

In normal operation the python program is launched automatically when a connection is made from the Java GUI.

Revision 102018-12-18 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 52 to 52
 

The Java GUI

Changed:
<
<
The Java GUI is called JPDMDBDepp. It can run on Windows or Linux. The latest version (described here) requires Java 11 and can be downloaded here. Unpack into your installation directory. Some files will require local customisations:
>
>
The Java GUI is called JPDMDBDepp. It can run on Windows or Linux. The latest version (described here) requires Java 11 and can be downloaded here. Unpack into your installation directory. Some files will require local customisations:
 
PDMDBKIT/doAnalysis.sh

Revision 92018-12-17 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 181 to 181
 
  • Prepare the test environment
  • Mount plug-ins on the tester board
  • Scan plug-in QR codes
Added:
>
>
  • Initial power test
 
  • Program the TCM e-fuses
  • Perform functional tests
  • Run analysis

Revision 82018-12-13 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 80 to 80
 mkfifo -m 0666 /dev/shm/mtb-to-mudaq
Added:
>
>
ALERT! These special files will disappear if your system is rebooted.

The file attributes (ls -l command) should look something like this:

prw-rw-rw- 1 lhcbrich z5        0 Dec 12 12:21 mtb-to-mudaq
prw-rw-rw- 1 lhcbrich z5        0 Dec 12 12:21 mudaq-to-mtb

If the first character is not p, delete the files and create them again.

 As lhcbrich in a separate terminal window run the following command:

Revision 72018-12-12 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 52 to 52
 

The Java GUI

Changed:
<
<
The Java GUI is called JPDMDBDepp. It can run on Windows or Linux. Download it here.
>
>
The Java GUI is called JPDMDBDepp. It can run on Windows or Linux. The latest version (described here) requires Java 11 and can be downloaded here. Unpack into your installation directory. Some files will require local customisations:

PDMDBKIT/doAnalysis.sh
PDMDBKIT/ncat-daemon.sh
  You also need the Digilent Adept2 environment. Download from here
Line: 75 to 80
 mkfifo -m 0666 /dev/shm/mtb-to-mudaq
Changed:
<
<
As lhcbrich
>
>
As lhcbrich in a separate terminal window run the following command:
 
Changed:
<
<
(ncat -k -l 7999) >/dev/shm/mudaq-to-mtb </dev/shm/mtb-to-mudaq &
>
>
ncat -v -k -l -c <absolute-directory-path>/ncat-daemon.sh 7999

Before doing so, you may need to edit ncat-daemon.sh to change the directory where your tester Python software is installed.

This program manages the network connection between the tester and the GUI and must always be running. The window may contain useful debug output.

 

Test sequence XML

Line: 125 to 136
 

Operating Instructions

Added:
>
>
Change to the PDMDBKIT directory in your installation area, for example:
 On Linux:
cd /lhcb/lhcbrich/Upgrade/PDMTBTesting/PDMDBKIT/
Line: 134 to 147
 cd /cygdrive/q/lhcb/lhcbrich/Upgrade/PDMTBTesting/PDMDBKIT/

Then

Added:
>
>
 
Changed:
<
<
java -jar JPDMDBDepp.jar
>
>
<path-to-java11-installation>/bin/java @JPDMDBDepp.opts
 

GUI interactions

Revision 62018-11-30 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 52 to 52
 

The Java GUI

Deleted:
<
<
The Java GUI is called JPDMDBDepp. It can run on Windows or Linux.
 The Java GUI is called JPDMDBDepp. It can run on Windows or Linux. Download it here.

You also need the Digilent Adept2 environment. Download from here

Line: 81 to 79
 
(ncat -k -l 7999) >/dev/shm/mudaq-to-mtb </dev/shm/mtb-to-mudaq &
Deleted:
<
<
IDEA!This (and the named pipes) could be replaced by directly opening a socket in the python code.
 

Test sequence XML

The test sequence is defined in XML. An example XML fragment is given below.

Line: 123 to 119
 
  1. udaq_interface.py provides methods for communicating with the MuDAQ firmware, particularly checking for responses and errors. You should not need to run or modify this file, although it must be present.
  2. module_test_functions.py provides functions for running each test on the microcontroller. You may need to change the name of the microcontroller serial port on line 13 of this file, depending on your system configuration, but you should not need to run it directly.
  3. test_supervisor.py is a process that waits for commands from the MuDAQ, then runs the appropriate test on the microcontroller and returns the result to the MuDAQ. You need to have this program running for the communication between the MuDAQ and microcontroller to work. A summary of messages sent and received will be printed to the terminal it it running in. You may need to change the name of the microcontroller serial port on line 20 of this file, or the pipe names on line 19 (depending on your system configuration). This should be the only file you need to run directly (see below).
Changed:
<
<
The software is written for Python 3.6. It will not work with Python 2.x. You can run it by navigating to the folder with the python scripts in it and typing: python3 test_supervisor.py
>
>
The software is written for Python 3.6. It will not work with Python 2.x.

In normal operation the python program is launched automatically when a connection is made from the Java GUI.

 

Operating Instructions

Revision 52018-11-28 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 22 to 22
 

Master link I2C

Changed:
<
<
Production boards are delivered to the test facility without the e-fuses being set. Therefore initial configuration of the master GBTX requires an I2C interface. MuDaq can operate as an I2C master. The physical I2C link will be through an adapter that plugs into JP5 ("GBT Dongle") of the module tester board. This adapter also provides the hardware required to program the master GBTX e-fuses. The adapter is connected to the tester unit using a short flat ribbon cable.
>
>
Production boards are delivered to the test facility without the e-fuses being set. Therefore initial configuration of the master GBTX requires an I2C interface. MuDaq can operate as an I2C master. The physical I2C link will be through an adapter that plugs into JP5 ("GBT Dongle") of the module tester board. This adapter also provides the hardware required to program the master GBTX e-fuses. The adapter is connected to the muDaq using a short flat ribbon cable.
 
SK4 Pin FPGA IO Signal
Changed:
<
<
1 N/A NC
2 N/A 3V3
3 N/A GND
>
>
1   NC
2   3V3
3   GND
 
4 F20 EFUSEPROG
5 E21 SDA
6 D21 EFUSEPWREN

Revision 42018-11-28 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 22 to 22
 

Master link I2C

Changed:
<
<
Production boards are delivered to the test facility without the e-fuses being set. Therefore initial configuration of the master GBTX requires an I2C interface. MuDaq can operate as an I2C master. The physical I2C link will be through an adapter that plugs into MuDaq.SK4. This adapter also provides the hardware required to program the master GBTX e-fuses. The adapter is connected to the tester unit using a short flat ribbon cable.
>
>
Production boards are delivered to the test facility without the e-fuses being set. Therefore initial configuration of the master GBTX requires an I2C interface. MuDaq can operate as an I2C master. The physical I2C link will be through an adapter that plugs into JP5 ("GBT Dongle") of the module tester board. This adapter also provides the hardware required to program the master GBTX e-fuses. The adapter is connected to the tester unit using a short flat ribbon cable.
 
SK4 Pin FPGA IO Signal
1 N/A NC

Revision 32018-11-28 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 24 to 24
  Production boards are delivered to the test facility without the e-fuses being set. Therefore initial configuration of the master GBTX requires an I2C interface. MuDaq can operate as an I2C master. The physical I2C link will be through an adapter that plugs into MuDaq.SK4. This adapter also provides the hardware required to program the master GBTX e-fuses. The adapter is connected to the tester unit using a short flat ribbon cable.
Added:
>
>
SK4 Pin FPGA IO Signal
1 N/A NC
2 N/A 3V3
3 N/A GND
4 F20 EFUSEPROG
5 E21 SDA
6 D21 EFUSEPWREN
7 C21 SCL
8 B21
 

Data links

MuDaq has 8 SFP ports. They are numbered differently on the PCB than in the firmware/software. They are used as follows:

Revision 22018-11-23 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="RichPdmdbProductionTesting"
Line: 176 to 176
 
  • Keep the modules in their anti-static bags except while under test.
  • Visually inspect the MEGARRAY connectors (both mating parts) before plugging any module.
  • When removing a module use an appropriate tool to secure the transitional adapter.
Changed:
<
<
  • Remove a module by lifting the front edge - avoid twisting/rocking.
>
>
  • Remove a module by lifting the front edge. Avoid twisting/rocking. Avoid using the VTTX/VTRX as a handle.
 
  • When mounting a module gently allow it to align itself and press down gently but firmly directly over the MEGARRAY connector - avoid twisting/rocking.
  • If the transitional adapters are damaged, replace them.

Revision 12018-11-23 - StephenWotton

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="RichPdmdbProductionTesting"

Hardware Installation

Module tester board

MuDaq

The topic RichMuDaq contains general information about the muDaq hardware,firmware and software. The supplementary information here is specific to the module testing environment.

Power

Use a 5V power supply (exact voltage is not critical but should not exceed 5.5V).

USB

Connect MuDaq to a USB2 port on the PC. Avoid connecting to a USB3 (SS) port.

Master link I2C

Production boards are delivered to the test facility without the e-fuses being set. Therefore initial configuration of the master GBTX requires an I2C interface. MuDaq can operate as an I2C master. The physical I2C link will be through an adapter that plugs into MuDaq.SK4. This adapter also provides the hardware required to program the master GBTX e-fuses. The adapter is connected to the tester unit using a short flat ribbon cable.

Data links

MuDaq has 8 SFP ports. They are numbered differently on the PCB than in the firmware/software. They are used as follows:

PCB legend FPGA MGT RX usage TX usage
SFP8 0 TCM.TX TCM.RX
SFP7 1 Unused Unused
SFP6 2 DTM0.GBTX0.TX Unused
SFP5 3 DTM0.GBTX1.TX Unused
SFP4 4 DTM1.GBTX0.TX Unused
SFP3 5 DTM1.GBTX1.TX Unused
SFP2 6 DTM2.GBTX0.TX Unused
SFP1 7 DTM2.GBTX1.TX Unused

Software Installation

The Java GUI

The Java GUI is called JPDMDBDepp. It can run on Windows or Linux.

The Java GUI is called JPDMDBDepp. It can run on Windows or Linux. Download it here.

You also need the Digilent Adept2 environment. Download from here

Setting up

The GUI must be run on the PC to which the muDaq USB is connected but this can be different to the microcontroller host PC since the Java to microcontroller host connection uses a network socket.

The program configures itself from cached XML files which are automatically updated from the Cambridge website every time the program is started and which are located in the execution directory and have prefix www-. Therefore the PC must be connected to the network the first time the GUI is run. Since these cached files would be overwritten every time the program starts it is recommended that the cached XML files are renamed to remove the www- prefix. The GUI will then use these files and not connect to the network. These files can then be customised if needed and will never be overwritten.

The microcontroller host Linux system must be prepared first to accept the network connections from the Java GUI.

As a user with sudo rights to allow connections to port 7999 through firewall (this has been added permanently on pcmi but the commands are given here for reference):

sudo iptables -I INPUT -i eth0 -p tcp -s 131.111.66.0/24 --dport 7999 -j ACCEPT
sudo iptables -I INPUT -i eth0 -p tcp -s 172.24.8.0/24 --dport 7999 -j ACCEPT

Create two named pipes that forward commands and responses between muDaq and tester

mkfifo -m 0666 /dev/shm/mudaq-to-mtb
mkfifo -m 0666 /dev/shm/mtb-to-mudaq

As lhcbrich

(ncat -k -l 7999) >/dev/shm/mudaq-to-mtb </dev/shm/mtb-to-mudaq &

IDEA!This (and the named pipes) could be replaced by directly opening a socket in the python code.

Test sequence XML

The test sequence is defined in XML. An example XML fragment is given below.

  <command label="muDAQ configure" targetClass="MuDaq" targetMethod="configure"/>
  <command label="muDAQ configure master link" targetClass="MuDaq" targetMethod="configureMasterLink"/>
  <command label="SCA setup" targetClass="ScaControl" targetMethod="setup"/>
  <command label="SCA set DACs" targetClass="ScaControl" targetMethod="setDac" data="0|33?1|127?2|75?3|92"/>
  <command label="SCA set GPIO[7:1]" targetClass="ScaControl" targetMethod="setGpio" data="7|1"/>
  <command label="MTB NOP" targetClass="PdmdbModuleTester" targetMethod="exec" data="NOP">
    <response opcode="ACK_OK" timeout="500" incrementSequenceNumber="true"/>
  </command>
  <command label="MTB measure power" targetClass="PdmdbModuleTester" targetMethod="exec" data="MEASURE_POWER|1111">
    <response opcode="ACK_OK" timeout="500" incrementSequenceNumber="true"/>
    <response opcode="MEASURE_POWER" timeout="3000"/>
  </command>

The commands reference static methods in the various Java GUI classes. The class (relative to cbsw.lhcb.pdmdb) is given in the targetClass attribute and the method in the targetMethod attribute. The fully-qualified target method signature is then

public static String cbsw.lhcb.pdmdb.targetClass.targetMethod(String [])

Any new methods that are added must conform to this signature. The String[] argument contains the tokenised target method data split at the | characters. The returned String starts with mandatory OK or FAIL text followed by | and any optional data.

For example. the tester MEASURE_POWER command results in a call

public static String cbsw.lhcb.pdmdb.PdmdbModuleTester.exec({"MEASURE_POWER","1111"})

Commands are executed in the order they are given in the XML. Where the commands target the test board, the GUI waits for each of the listed responses before proceeding. A timeout in milliseconds can be applied to the tester responses. The GUI will abort the sequence when a timeout occurs or when an unexpected response is received.

The label attribute is used as the test button label on the tester sequence panel.

If the same command needs to be executed several times by the same target method this can be done by concatenating the target method data using the ? character as separator. See, for example, the setDac method in the XML above.

The incrementSequenceNumber="true" attribute should normally appear on the first response of each command. However, under some circumstances, responses after the initial ACK_OK may be handled in the response list of the next command. In this case the attribute should not appear on the deferred response.

Python software

The Python software forms the interface between the Java MuDAQ software and the microcontroller firmware. It is made up of four files (modules).

  1. serial_interface.py provides methods for communicating with the microcontroller firmware, particularly checking for responses and errors. You should not need to run or modify this file, although it must be present.
  2. udaq_interface.py provides methods for communicating with the MuDAQ firmware, particularly checking for responses and errors. You should not need to run or modify this file, although it must be present.
  3. module_test_functions.py provides functions for running each test on the microcontroller. You may need to change the name of the microcontroller serial port on line 13 of this file, depending on your system configuration, but you should not need to run it directly.
  4. test_supervisor.py is a process that waits for commands from the MuDAQ, then runs the appropriate test on the microcontroller and returns the result to the MuDAQ. You need to have this program running for the communication between the MuDAQ and microcontroller to work. A summary of messages sent and received will be printed to the terminal it it running in. You may need to change the name of the microcontroller serial port on line 20 of this file, or the pipe names on line 19 (depending on your system configuration). This should be the only file you need to run directly (see below).
The software is written for Python 3.6. It will not work with Python 2.x. You can run it by navigating to the folder with the python scripts in it and typing: python3 test_supervisor.py

Operating Instructions

On Linux:

cd /lhcb/lhcbrich/Upgrade/PDMTBTesting/PDMDBKIT/

On Windows (Cygwin)

cd /cygdrive/q/lhcb/lhcbrich/Upgrade/PDMTBTesting/PDMDBKIT/

Then

java -jar JPDMDBDepp.jar

GUI interactions

The Play button executes the whole sequence from the beginning. The Pause button flags the sequence to stop at the next opportunity. Resume will continue from where the sequence paused.

Step executes the commands consecutively one at a time on each click. First step resets to the beginning of the sequence and executes the first command. Resume can be used in step mode to continue automatically from the last executed command.

Individual commands may be executed by clicking the corresponding button. However, this does not change the current position in the sequence as used by Step and Resume. This is a convenient way of retrying a failed command.

In case the GUI aborts a transaction, it may be necessary to empty the response FIFO. A Read flush button is provided on the tester sequence panel to do this. It reads the FIFO in a loop until a timeout occurs indicating that the FIFO is empty. After this a NOP instruction should be sent to synchronise with the tester.

The testing process

It is best to leave MuDaq always powered but the TCM and DTM power must be off when mounting and dismounting the plug-ins. The test sequence should do this automatically but it is important to check.

The principal steps of each automated test cycle are:

  • Prepare the test environment
  • Mount plug-ins on the tester board
  • Scan plug-in QR codes
  • Program the TCM e-fuses
  • Perform functional tests
  • Run analysis
  • Repeat from the beginning

During the testing process, all commands and responses are recorded and datasets containing eye scan and phase scan data are saved. A new data directory is created for each test cycle. A standalone program extracts the test results from these datasets and generates a test report summary for each module.

Note that the test sequence runs in an infinite loop but will wait for input at the QR scan step. Therefore this is a convenient point at which to replace the plug-in modules. The test sequence will continue automatically after the last QR code is scanned.

The sequence can be interrupted by clicking Pause. The sequence will then stop at the end of the currently running step. In case of error, it is best to restart the cycle from the beginning.

Notes on e-fusing

ALERT! Special care must be taken to monitor that the e-fusing is proceeding correctly. If there is any doubt, do not continue the testing process until the problem is understood and resolved. E-fusing is an irreversible process.

Some extra checks are done in the automatic sequence and the e-fusing is disabled if any problem is detected. The software checks whether the master GBTX has already been fused and will skip the e-fusing in this case. This is not regarded as an error as it is likely that a test cycle will sometimes have to be repeated so the sequence should continue normally in this case.

As additional protection, a software token must be granted to enable the e-fusing process. The token automatically expires after some time (currently 25 hours) to avoid that e-fusing is unintentionally left enabled for long periods. The token can be granted/extended from the main test sequence panel. It can also be manually expired and it is recommended to do this at the end of testing shift. If the test cycle fails because the e-fusing token has expired, simply grant/extend the token and restart the test cycle.

Notes on handling of the hardware

  • Take reasonable precautions against static discharge.
  • Use the correct (JIS) screwdriver to attach the optical modules - one screw is sufficient closest to the module edge. Do not over-tighten.
  • Use a jig when attaching the stand-off. Do not apply force to any other component.
  • Carefully replace the MEGARRAY connector covers and optical module protectors when the modules are not plugged in.
  • Keep the modules in their anti-static bags except while under test.
  • Visually inspect the MEGARRAY connectors (both mating parts) before plugging any module.
  • When removing a module use an appropriate tool to secure the transitional adapter.
  • Remove a module by lifting the front edge - avoid twisting/rocking.
  • When mounting a module gently allow it to align itself and press down gently but firmly directly over the MEGARRAY connector - avoid twisting/rocking.
  • If the transitional adapters are damaged, replace them.

Command reference

-- StephenWotton - 2018-11-23
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback