How-To: UNILAC Chopper - Firmware and Monitoring

Introduction

The main documentation about the (new) UNILAC chopper can be found here.

This how-to describes the lm32 firmware and related monitoring, a dedicated documentation can be found here.

This tool only serves to write 3x 16bit data to the UNILAC Choppersteuerung in hard real time. This is initiated by a host system application and executed by a lm32 firmware in the FPGA.

Monitoring

A simple monitoring app is available via Launcher -> Entwicklung -> 'Emergency Chopper Monitor'.

chopper-monitor.png
Figure: Screenshot of the UNILAC chopper monitor. The status is displayed for each Sequence ID ('virtual accelerator') 0..15. Details see text.

The figure above shows an example of the chopper monitor. The status is given for each Sequence ID (previously known as 'virtual accelerator') separately. Information is only given, if the the Sequence / virtual accelerator is actually executed. If the data is older than a certain time span (~ one hour) it is removed from the display.

Display

Identification
  • SID: Sequence ID
  • what: HLI or HSI chopper
  • UTC: time of most recent execution [UTC]

Statistics
  • #cycles: number of cycles
  • #chop: number of executed chops
  • #interlock: number cycles where the chopper was disabled due to an interlock; here, 'interlock' means a slow interlock via (mini-)masp.
  • #block: number of cycles where the chopper was disabled due to 'blocked' beam; here, 'blocked' means that the beam should not be executed (disabled in the BSS App or other reasons)
  • #failChop: number of cycles where the copper was expected to chop, but it didn't
  • #wrongChop: number of cycles where the chopper was not supposed to chop, but it DID chop
  • #cciFail: number of cycles where no set-values have been received from the Chopper Control Interface FESA class
  • #cciFail: number of cycles where the set-value from CCI FESA class have been received too late

Actual Status
  • lenTrig [us]: measured length of the trigger signal at the output of the chopper control hardware; this value should correspond to ParamModi -> Tab 'UNILAC: Modi' -> 'Strahlpulslänge'
  • tChop [us]: measured 'time' of the rising edge of the chopper signal; 'time' is relative to the rising edge of the trigger signal and has a value in the one-digit microseconds range
  • lenChop [us]: measured length of chopper pulse and should have the same value as 'lenTrig'
  • ilk: chopper disabled due to interlock signal detected by MASP
  • block: chopper disabled due to 'bock' by MASP
  • nobeam: UNILAC cycle is executed and the 'no beam' flag is set in the timing messages received from the Data Master
  • wrChop: wrong choppe - chopper has been opened although it was not supposed to

2nd last line: hostname of SCU where the Chopper Control Interface is running; firmware version; firmware state

last line: number of 'late' messages received; status information (usually this reads 0x401)

User Control

  • '0..9, a..f': The statistics information is aggregated by the server program on the frontend. Thus, all monitor applications display the same information everywhere. The statistics can be reset for each Sequence / virtually accelerator individually. By pressing the relevant key 0..f, the information on the server program is reset. With the next execution, the data is reset for all monitor applications.
  • h: display help text; basically, the URL of this wiki page is displayed
  • q: quits the monitor application

Command Line Interface

A command line interface provides additional information

ruth@scuxl4711:~# unichop-ctl dev/wbm0 diag
common: diags ...
firmware boot at                    : 2024-11-12 14:44:09 TAI
diagnostics reset at                : 2024-11-12 14:44:18 TAI
version                             : 000012
mac                                 : 0x00267b00074c
ip                                  : 192.168.161.167
used shared mem [byte]              : 432
state (# of changes)                : OpReady    (0)
# of transfers                      : 000000000000
# of injections                     : 000000000000
status of act transfer              : 0x0
# late events                       : 000000000045     // number of late events; most likely these are events by the FESA class delivered through saftlib
'offset done' (processing time) [us]:    96805.548     // this large value indicates a malfunction (saftlib, FESA); usually a value < 350us is expected
communication latency [us]          :    96804.372     // this large value indicates a malfunction (saftlib, FESA); usually a value < 5us is expected
sum status (# changes)              : 0x401 (45)
overall status                      : OK
    status bit is set               : error 10, late timing message received
    status bit is set : error 10, late timing message received
unichop: info  ...

MIL Device (0: piggy, 1..: SIO N)   :               1  // here: SIO in slot #1
# of MIL transactions               :        23696544  
# of MIL communication errors       :               0
# of events received                :         7898893  // number of events from the FESA class, expected rate is 50 Hz

Usage

All communication to and from the firmware is implemented via the ECA - using timing messages. Documentation is available via the command line help.

ruth@scuxl4711:~# unichop-ctl dev/wbm0 -h
Usage: unichop-ctl [OPTION] <etherbone-device> [COMMAND]

  -h                  display this help and exit
  -e                  display version
  -i                  show chopper information

All following parameters are to be used with command 'configure' 
  -w <MIL device>     MIL device for sending MIL messages; 0: MIL Piggy; 1..: SIO
                      
  configure           command requests state change from IDLE or CONFIGURED -> CONFIGURED
  startop             command requests state change from CONFIGURED -> OPREADY
  stopop              command requests state change from OPREADY -> STOPPING -> CONFIGURED
  recover             command tries to recover from state ERROR and transit to state IDLE
  idle                command requests state change to IDLE

  diag                shows statistics and detailed information
  cleardiag           command clears FW statistics

Use this tool to control (some) properties of the UNILAC chopper from the command line
Example:
  'unichop-ctl dev/wbm0 -w1 configure'
  'unichop-ctl dev/wbm0 startop'
  'unichop-ctl dev/wbm0 diag'

For testing and debugging timing messages can be sent / received via saftlib
GID:
      0xff0: group for local timing messages that are sent TO the lm32 firmware
      0xff1: group for local timing messages that are sent FROM the lm32 firmware
EvtNo:
      0xfa0: host -> lm32      : write strahlweg and anforder data
      0xfa1: host -> lm32      : read strahlweg and anforder data
      0xfb0: host -> lm32      : standard MIL write
      0xfb1: host -> lm32      : standard MIL read
      0xfc2: WR -> lm32 -> host: actual chopper readback data HLI
      0xfc3: WR -> lm32 -> host: actual chopper readback data HSI

Examples: write/read host<->lm32<->MIL<->chopper unit:
saft-ctl tr0 -p inject 0x1ff0fa0000000000 0x0000000ab00ff0001 0
      write strahlweg and anforder data to HW            ^^^^ : strahlweg_register
                                                     ^^^^     : strahlweg_maske
                                                 ^^^^         : anforder_maske
saft-ctl tr0 -p inject 0x1ff0fa1000000000 0x0000000000000000 0
      read strahlweg and anforder data from HW

Example: receive strahlweg data read from chopper unit:
saft-ctl tr0 -x snoop 0x1ff1fa0000000000 0xffffff0000000000 0
tDeadline: 0x17f6e1ba6fe69830 EvtID: 0x1ff1fa1000000000 Param: 0x0000000000ff0001
        GID data received from lm32:    ^^^
        EvtNo read strahlweg data  :       ^^^
                               value of anforder maske       :       ^^^^
                               value of strahlweg maske      :           ^^^^
                               value of strahlweg register   :               ^^^^

Example: MIL bus diagnostic (here: write of 'strahlweg maske'):
saft-ctl tr0 -x snoop 0x1ff1fb0000000000 0xffffff0000000000 0
tDeadline: 0x17f6e1582eb79100 EvtID: 0x1ff1fb0000000000 Param: 0x00010160096200ff
           GID data received from lm32: ^^^
           EvtNo MIL write            :    ^^^
                                            MIL error code   :   ^^^^
                                            SIO slot         :       ^^
                                            MIL ifb addr     :         ^^
                                            module addr      :           ^^
                                            submodule addr   :             ^^
                                            data             :               ^^^^


Examples: standard MIL write/read host<->lm32<->MIL<->MIL device
saft-ctl tr0 -p inject 0x1ff0fb0000000000 0x000000600013cafe 0
      write value to IFA echo register                  ^^^^: data
                                                      ^^    : register
                                                    ^^      : module addr, 0: IFA
                                                  ^^        : MIL ifb addr
saft-ctl tr0 -p inject 0x1ff0fb1000000000 0x0000006000890000 0
      read value fom IFA echo register                  ^^^^: reserved
                                                      ^^    : register
                                                    ^^      : module addr, 0: IFA
                                                  ^^        : MIL ifb addr
saft-ctl tr0 -x snoop 0x1ff1fb1000000000 0xfffffff000000000 0
tDeadline: 0x17f6e324b8b808c0 EvtID: 0x1ff1fb1000000000 Param: 0x000101600089cafe
        GID data received from lm32:    ^^^
        EvtNo MIL read             :       ^^^
                                            MIL error code   :   ^^^^
                                            SIO slot         :       ^^
                                            MIL ifb addr     :         ^^
                                            module addr      :           ^^
                                            submodule addr   :             ^^
                                            data             :               ^^^^

Example: read version of 'logic module 1' in chopper unit via standard MIL
saft-ctl tr0 -p inject 0x1ff0fb1000000000 0x0000016009660000 0
      read value from  MIL                      ^^           : SIO slot
                                                  ^^         : MIL ifb addr
                                                    ^^       : module addr
                                                      ^^     : submodule addr
saft-ctl tr0 -x snoop 0x1ff1fb1000000000 0xfffffff000000000 0
tDeadline: 0x17f6e3999a40d0d8 EvtID: 0x1ff1fb1000000000 Param: 0x0001016009660014
                                                      version:               ^^^^

Example: write and read chopper unit 'strahlweg register' via standard MIL
saft-ctl tr0 -p inject 0x1ff0fb0000000000 0x00000060096007ff 0
      write value                                       ^^^^: data
                                                      ^^    : submodule addr
                                                    ^^      : module addr
                                                  ^^        : MIL ifb addr
saft-ctl tr0 -p inject 0x1ff0fb1000000000 0x0000006009600000 0
      read value                                        ^^^^: reserved
                                                      ^^    : submodule addr
                                                    ^^      : module addr
                                                  ^^        : MIL ifb addr

Example: actual chopper readback data for HSI
saft-ctl tr0 -x snoop 0x1ff1fc3000000000 0xfffffff000000000 0
tDeadline: 0x17ff97ecad3b9ad0 EvtID: 0x1ff1fc3000900000 Param: 0x01f4000001f401f4
                                                    ^        :                   
 bpid bit 0,1: 0x0, 2: block, 3: interlock, 4: CCI received, 5: CCI late         
                        measured length of chopper pulse     :               ^^^^
                        measured time of chopper falling edge:           ^^^^    
                        measured time of chopper rising edge :       ^^^^        
                        measured time of ctrl falling edge   :  ^^^^             
                        NB: value 0x7fff: no data; 0xffff invalid data           

Report software bugs to <d.beck@gsi.de>
Version 00.00.12. Licensed under the LGPL v3.

NFS-Init

Configuration of the frontend is done via nfs-init.

Example for PRO:
[me@asl789 scuxl4711]$ ll
total 4
lrwxrwxrwx 1 me      bel 29 Oct 18 17:48 20_unichop_unichop-tools -> ../global/timing-rte-db-yocto                // tools
lrwxrwxrwx 1 me      bel 29 Oct 18 17:49 30_unichop_unichop-pro-lsb6-config -> ../global/timing-rte-db-yocto      // launch and config firmware
lrwxrwxrwx 1 me      bel 29 Oct 18 17:49 40_unichop_unichop-pro-lsb6-systemd -> ../global/timing-rte-db-yocto     // launch monitoring server
-rwxr-xr-x 1 person  bel 88 Nov  6 17:11 51_fesa                                                                  // launch FESA

Example for INT, note the differences in the names of the symbolic links (click):
[me@asl789 scuxl4712]$ ll
total 4
lrwxrwxrwx 1 me      bel 29 Oct 18 17:48 20_unichop-dev_unichop-tools -> ../global/timing-rte-db-yocto            // tools
lrwxrwxrwx 1 me      bel 29 Oct 18 17:49 30_unichop-dev_unichop-int-lsb6-config -> ../global/timing-rte-db-yocto  // launch and config firmware
lrwxrwxrwx 1 me      bel 29 Oct 18 17:49 40_unichop-dev_unichop-int-lsb6-systemd -> ../global/timing-rte-db-yocto // launch monitoring server
                                                   ^^^^         ^^^ ^^^^
                                                      |           |    |- location
                                                      |           |- environment
                                                      |- path 
-rwxr-xr-x 1 person  bel 88 Nov  6 17:11 51_fesa                                                                  // launch FESA 

Code, Build, Deployment

Code is here: bel_projects/tree/.../modules/uni-chop

For branch and hash of the current version check the logbook

For building and deployment check the comments given at the top of the 'Makefile'

Example for building and deployment for PRO (assuming target system runs Yocto ramdisk)
make clean                                                                  // clean
make ENV=pro SYSENV=YOCTO PREFIX= all                                       // builds software, firmware and generate nfs-init scripts
make PREFIX= SYSENV=YOCTO STAGING=/common/export/timing-rte/unichop deploy  // copies stuff to location where nfs-init will find it

-- DietrichBeck - 14 Nov 2024
Topic revision: r3 - 2024-11-14, dbeck - This page was cached on 2024-12-15 - 13:33.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Legal notice | Privacy Policy (german)