Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Loads an FPGA image onto the specified AMC card, must be invoked on the target MTCA CPU.

...

tools/

...

flash_

...

fpga

Code Block
languagetext
start_ioc ioc-name

This script should be passed the name of an IOC configured in the iocs directory.  The IOC is launched (using epics/runioc) under procServ.

...

tools/flash_fpga amc525_lmbf.bit 200

Permanently stores FPGA image on the specified AMC525 card.  The last octet of the AMC525 card is specified, and this tool must be run on the MTCA system.  The given image will be automatically loaded as the AMC card boots.  It takes just over 4 minutes to run this command as writing to the flash is slow.

tools/start-ioc

An IOC is configured by creating a soft link to this script with the name of the IOC in the iocs directory.

...

Code Block
languagetext
Usage: runioc [options] config-file
Starts MBF IOC with configured options.
    -v      Run with valgrind memory checker enabled
    -l      Add leak check to valgrind (must specify -v first)
    -t      Add track origins to valgrind (must specify -v first)
    -q      Disable PV logging
    -u      Don't lock hardware registers
    -z      Disable delay compensation
    -n      Run without initialising hardware

This is the main launcher for running the EPICS IOC.  Don't use the -v option for normal operation as it slows things down too much.  The -z option is only for use with delay compensation measurement.  The -n option is only useful for demonstration or simple IOC debugging.

This script should not normally be run directly, instead use start_ioc or use the launcher link links in iocs.

epics/setup_mbf

Code Block
languagetext
setup_mbf ioc-config

...

All of the scripts described here are run as helpers for the EDM screens.

epics/opi/scripts/mbf-run-command

This is a wrapper script for running other helper scripts in a temporary xterm terminal.  This is done so that if the script fails then the output can be reviewed.

...

This script launches Firefox to view the appropriate help page when the help button  on a GUI screen is pressed.

...

sites/

...

DLS/scripts/mbf-setup-tune

This script is Diamond specific, and is called in response to each of the "Tune" setup buttons at the bottom of the MBF Overview page (as configured at Diamond).

Code Block
languagetext
usage: mbf-setup-tune [-h] [-c CONFIG] [-d] [-m RING_MODE] [-t TUNE] [-n]
                      device mode

Configure device in specified setup mode.

positional arguments:
  device        TMBF device name to configure
  mode          Configuration mode, must be one of TUNE, AP, FB

optional arguments:
  -h, --help    show this help message and exit
  -c CONFIG     Alternative configuration file
  -d            Enable debug mode
  -m RING_MODE  Specify ring mode, otherwise PV will be consulted
  -t TUNE       Specify tune, otherwise config file will be consulted
  -n            Dry run, don't actually write to device

...

FileDescription
setup_defaults.pyThis sets defaults for all of the settings that will be written by this script.
MBF_tune.configThis file is designed to be edited by operators and is used to fine tune the behaviour of this script.

epics/opi/scripts/mbf-set-waveform

Code Block
languagetext
mbf-set-waveform PV value [bunch]

...

.

...

This helper function is called from the bunch bank setup screen and is used for a variety of update functions.

Tune Fitter

The tune fitter is managed by the following scripts.

...

Scans through ADC clock to data delays and shows result from reading test pattern.  Needs to be run on initial commissioning of new hardware, and should be checked after updating firmware.

Areas of Concern for Portability

The following issues will need to be sorted out.

...

tools/find_freq

Code Block
languagetext
$ ./find_freq 499.682
VCO0 D = 5
(R2 =  55, N2 = 1374 = 2 *  687), offset = +91.3%
(R2 =  57, N2 = 1424 = 2 *  712), offset = +65.8%
(R2 =  58, N2 = 1449 = 3 *  483), offset = +53.7%
(R2 =  59, N2 = 1474 = 2 *  737), offset = +42.0%
(R2 =  61, N2 = 1524 = 2 *  762), offset = +19.8%
(R2 =  63, N2 = 1574 = 2 *  787), offset =  -1.1%
VCO1 D = 6
(R2 =  46, N2 = 1379 = 7 *  197), offset = +88.7%
(R2 =  53, N2 = 1589 = 7 *  227), offset =  -7.1%

Searches through possible settings for clock PLL divisors to meet the given target frequency (in MHz).  Returns a list of possible VCOs and a list of possible divisors in descending order of offset.  The offset percentage indicates how far the target frequency is from the tunable centre frequency as a percentage of the full tunable range (±10-4).