AMC13Tool2 is a command-line utility designed to exercise all functions of the AMC13. The tool can be run in either interactive or scripted mode.


AMC13Tool2.exe  [-p ] [-X ] [-i ] ...  [-c ] ...  [--] [--version] [-h]

Argument Type Notes
-p, --path path path to address table files (if not using connection file)
-X, --script string name of script file to execute
-c, --connect file name or ip address connection file name or ip address (may be repeated for multiple AMC13)
-i, --id string connection file ID prefix (requires connection file too)


The tool make be started with no command-line options, in which case it will immediately enter interactive mode without establishing communication with any AMC13. Typically the first interactive command would then be "connect" to attach an AMC13.

Specifying AMC13 Modules

Use the -c argument to specify AMC13 modules to communicate with.

IP Address

The argument after -c may be a numeric I/P address, in the standard form e.g. To specify the control hub protocol, append /c e.g. _Specify the T2 board (lower) IP address._ The tool will automatically connect to the address specified + 1 for T1.

If you specify an IP address, you must also tell the tool where to find the IPBus address tables. You can either set the environment variable AMC13_ADDRESS_TABLE_PATH or use the -p option on the command line to do this. The path must be the name of a directory containing the two files AMC13_T1.xml and AMC13_T2.xml. (In the standard source distribution these are symlinks in the directory ...amc13/etc/amc35 below the top level. In the RPM distribution they are in /opt/cactus/etc/amc13).

Connection File

Alternatively you may specify the name of a connection file. See Cactus Tutorial for details.

If you specify a connection file, by default it must contain the entries with ID T1 and T2 for one AMC13. If you have multiple ID in the same file, name them with different prefixes and pairs ending in .T1 and .T2. Then specify the ID prefix with the -i command-line argument.

Running Scripts

A script file may be created with a list of AMC13Tool2 commands. A script may be executed in two ways:

  1. By specifying the file name after -X (note capitol X) on the command line
  2. By executing the command include in interactive mode or from within another script

After executing a script the tool will normally return to interactive mode. If you wish the tool to exit (e.g. so you can run scripts from within a shell script) just terminate the script with the command quit.

Interactive Mode

The tool will enter interactive mode after executing any scripts specified. A > prompt is displayed. Type h for a list of commands. Type h <command> for detailed help, or h * for detailed help on all commands.

Generally, interactive commands consist of a command word followed by optional arguments. The command words are case-sensitive. Each command may have aliases (alternative names) given in parenthesis in the help.

Numeric arguments are interpreted as decimal unless prefixed with 0x in which case they are interpreted as hexadecimal.

Tab completion and history editing are provided by the GNU readline library. Tab completion is particularly useful for command words and address table entries.

Wildcards are permitted in address table entries in certain cases. For example, the command *readT1 stat*ttc*err* will read and display all address table entries matching the expression with wildcards.

Wildcards are simple shell-style by default, where * matches any string. An argument may be preceded with the string perl: to force full perl-style regular expression matching.

Detailed Command List

help (h)

Display list of commands. A command name may be given for a longer description of a particular command.

quit (q, exit)

Exit the program.


Echo the arguments after the command to the terminal (useful in scripts)


Delay execution for the specified time in seconds. Decimal values may be used.

connect <module_id>

Connect to an AMC13 using the specified IP address or connection file. See section above for details on the syntax.

list (fv)

List all connected AMC13 modules with firmware version, serial number and IP addresses. The module currently accepting commands is marked with a - character.

For example:

Connected AMC13s
*0: SN:  86 T1v: 0211 T2v: 0021 cf:
 1: SN:  82 T1v: 4007 T2v: 0021 cf:

sel <number>

Select an AMC13 to accept commands. Specify a number as shown in the output of the list command.

readT1 (rv) <address> [<count>]
readT2 (rs) <address> [<count>]

Read from a register on the T1 or T2 board. <address> may be any of the following:

  • a numeric address (remember to use 0x prefix for hex
  • the name of one address table item
  • an expression containing wildcard characters

An optional count may be given if the address specifies a single register. The specified number of 32-bit words will be read and displayed.

All displayed values are in hex.

writeT1 (wv) <address> [<data>]
writeT2 (ws) <address> [<data>]

Write to an address on T1 or T2 board. Address may be numeric or an address table item. Data must be numeric.

Data may be omitted in which case a special masked write is performed. This is typically used for address table items with names starting with ACTION.. For example:


Will correctly reset the T1 board.

i (en) <inputs> <options> (initialize AMC13 for data taking)

 i (en)              :   Initialize AMC13
                             inputs:   list of inputs e.g. '1-12'
                                       '*' enables all inputs which show AMC link ready
                             options:  T to enable loop-back TTC on TTS output fiber
                                       F to generate fake events in AMC13
                                       N to leave AMC13 out of run mode after initialization

daq <config>

 daq                 :   Enable DAQ outputs
                           daq 1|2|3 d
                               1  - enable SFP0 (top) DAQ fiber for AMC1-AMC12 readout
                               2  - enable SFP0 for AMC1-AMC6, SFP1 for AMC7-AMC12
                               3  - enable SFP0 for AMC1-AMC4, SFP1 for AMC5-AMC8, SFP2 for AMC9-AMC12
                               d  - disable all fibers
                           note:  recommend doing 'rd' (daq reset) after changing configuration
 localL1A            :   Configure local L1A generator
                          options:  o specifies one trigger per  orbits
                                    b specifies one trigger per  BX
                                    r specifies random triggers in  * 2 Hz
                                    d disable local L1A
                            burst:  number of triggers per burst in single-burst mode
                             rate:  number of orbits or BX between triggers or random rate in 2Hz units
 prescale            :   set prescale mode and factor
                            mode:  0 for simple prescale (record every n events, n from 1...0x10000)
                                   1 to match EvN with n low bits =0 where n from 5..20
                          factor:  if mode=0, 1...0x10000
                                   if mode=1, 5..20
 lt                  :   Send/enable/disable local triggers
                           lt     send  local trigger (bursts) in software loop
                           lt e        enable trigger generator
                           lt d        disable trigger generator
                           lt c        enable continuous mode (configure with localL1A)

rg (general reset)

Reset most AMC13 logic. For firmwares before 0x20f/0x4006 this resets DAQ links too. After this version, use 'rd' to reset DAQ separately

rc (counter reset)

Reset AMC13 counters.

rd (DAQ reset)

DAQ Link reset (firmware 0x20f/0x4006 and above)

 start               :   Enable run mode
 stop                :   Disable run mode
 nodes               :   List address table nodes -- list {T1|T2} 
 re                  :   Read next event from SDRAM
 df                  :   Read events and write to binary file -- df file [count]
 printFlash          :   print flash data for testing only
 verifyFlash         :   verify flash data from file -- verifyFlash file address
 programFlash        :   program flash data from file -- programFlash file address
 reconfigureFPGAs    :   reconfigure FPGAs from flash
 verifyFlashFile     :   verify flash data from file -- verifyFlash file
 programFlashFile    :   program flash data from file -- programFlash file
 selectFileTest      :   test function for MCS file parsing -- selectFileTest file
 vfh                 :   verify flash header -- vfh OR vfh 
 vbs                 :   verify flash golden -- vbs OR vbs 
 vs                  :   verify flash spartan -- vs OR vs 
 vv (vk)             :   verify flash virtex/kintex -- vv OR vv 
 pfh                 :   program flash header -- pfh OR pfh 
 pbs                 :   program flash golden -- pbs OR pbs 
 ps                  :   program flash spartan -- ps OR ps 
 pv (pk)             :   program flash virtex/kintex -- pv OR pv 
 devstatus (dst)     :   Display AMC13 Status
                           level from 1..9 with 1 being least verbose
                           debug if present enables lots of debug output for Eric
 status (st)         :   Display AMC13 Status
                         status  table_name
                           level from 1..9 with 1 being least verbose (99 displays everything)
                           table_name limits the display to the table named
 statusHTML          :   Display AMC13 status in basic HTML format
                         statusHTML  table_name
                           level from 1..9 with 1 being least verbose (99 displays everything)
                           table_name limits the display to the table named
 openStatusFile      :   Open a text file to stream status info to
 closeStatusFile     :   Close the text file

-- EricHazen - 18 Oct 2014

This topic: BUCMSPublic > WebHome > HcalDTC > AMC13CppSoftware > AMC13CppProductionSoftware > AMC13Tool2
Topic revision: r4 - 20 Oct 2014 - EricHazen
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback