Reseting CTB timing endpoint (ctb_control
tool)
The
ctb_control
tool was implemented to allow limited access to the CTB internal configuration without the need to ssh into the board.
ctb_control
is installed in
/nfs/sw/scripts
, which is accessible from any
np04-srv-XXX
server. For the user
np04daq
, the tool is available directly (
/nfs/sw/scripts
is included in the
$PATH
).
TL;DR : How to reset the CTB timing endpoint
In case the CTB timing endpoint goes into an error state (happens occasionally), do the following:
- Check the status of the CTB timing endpoint:
Use option
-s
.
[np04daq@np04-srv-012 ~]$ ctb_control -s
Thu Oct 25 23:04:49 2018 : Starting
main:: Checking timing status
Thu Oct 25 23:04:49 2018 : Initiating operation.
Thu Oct 25 23:04:49 2018 : Checking status of timing endpoint
Thu Oct 25 23:04:50 2018 : Timing status register :
Full register : 0x80000000
Timing state : 0x8
if the timing state is
0x8
then the CTB timing endpoint is in a good state and
should not be reset. The problem lies elsewhere.
- Reset the timing endpoint:
If the state reported in the previous step
was not 0x8
then reset with option
-r
:
[np04daq@np04-srv-012 ~]$ ctb_control -r
Thu Oct 25 17:09:12 2018 : Starting
main:: Resetting the CTB timing endpoint
Thu Oct 25 17:09:12 2018 : Initiating operation.
Thu Oct 25 17:09:12 2018 : Resetting CTB timing endpoint
Thu Oct 25 17:09:13 2018 : Timing endpoint successfully reset. Final state :
Full register : 0x80000000
Timing state : 0x8
NOTE: Occasionally, the final state does not report
0x8
, as the timing endpoint takes quite a long time to initialize, causing a race condition. If that is the case, repeat step 1 (check the state again) to confirm the timing is now in a good state (
0x8
).
Implemented features
The tool has a help menu that gives a minimal explanation of the options available:
$ ./ctb_control -h
Thu Oct 25 16:58:28 2018 : Starting
USAGE: ctb_control [options]
Options:
-c <CTB ip>, --ctb=<CTB ip> Destination of the CTB (optional).
-h, --help Print usage and exit.
-s, --state Check timing endpoint state.
-d, --dump Dump status of all registers.
-r, --reset Reset the timing endpoint.
-f <password>, --force=<password> Force the reset even if the board *thinks* it is taking
data. WARNING: Will cause CTB operation to stop. This
operation requires a super secret password.
Keep in mind that a single request can be made at a single time. Only one of the options
-s
,
-d
,
-r
can be used at at time.
Below is a more complete explanation of the implemented features and how to use them:
- Check the status of the CTB timing endpoint (option
-s
)
This requests the CTB to report on the status register of the timing endpoint. If everything is well, the state should be
0x8
. Any other value represents a bad state.
- Dump the status of all CTB registers (option
-d
)
This requests the CTB to report on the status of all configuration registers. Unless you are aware of the intrinsics of the CTB, this won't give you useful information.
There is, however, one register that can be explained. Bit 31 of register 0 indicates if the CTB is taking data.
- Reset the CTB timing endpoint (option
-r
)
This requests the CTB to assert and then deassert the reset signal to the timing endpoint, effectively reinitializing it.
Note that this will cause the timing endpoint on the timing system to go into an error state, so a reset of the CTB timing endpoint should be followed by a reset of the timing system. That is not covered here (contact the timing experts).
If the CTB is running or the timing endpoint is not in an error state, this command won't do anything and an error message will be returned indicating that. If you still want to go ahead and still want to reset the CTB timing endpoint you must use the
force mode (see below).
- Force reset the CTB timing endpoint (options
-r -f PASSWORD
)
This should not be done unless something very mysterious has happened. If the CTB reports that it is running, or the timing endpoint reports as being in a good state, there is no reason to reset it and therefore a
force option
-f
has to be passed.
This option requires a password, which one of the CTB experts will provide on a
case by case basis, upon receiving a request of no less than 20 pages explaining the reason why one would want to reset the board without it being in an error state.
CTB Configurations
See link for a description of the configuration parameters.
https://docs.google.com/document/d/1Qh5yVPb7FYcvO6PkwSxMI-9CSAEeXCx6DUKreOBwW54/edit?usp=sharing
CTB Triggers
See the following link for a spreadsheet to view the current triggers and parameters. In addition, new trigger parameters can be calculated and
must be documented here (expert, expert only!)
https://docs.google.com/spreadsheets/d/1d5Txk3Brd8GfNTDwR2hwk4zWlwhou1W3bB6Ku_jRAXI/edit?usp=sharing