Front-End Control and Configuration (FeC2) program

Instructions for FeC2 (Front-End Control and Configuration) program

Calling sequence:

FeC2 [-m <minor> | -r <revision> -n <serial>] [-c <RORC channel>]
     [-f <FeC2 script file>] [-l <log file>] [-t <DDL timeout>] 
     [-o <mem offset>] [-u <mem size>] [-s] [-v] [-h]
where:
  <minor>           : minor number of the Rorc device. The default is 0.
  <revision>        : RORC PCI revision number. Must be < 5.
  <serial>          : RORC hw serial number.
                       If given RORC is identified by <revision> and <serial>,
                       not by <minor> number.
  <RORC channel>    : RORC channel number, default: 0.
  <FeC2 script file>: name of the script file. The default is FeC2.scr
  <log file>        : the name of the log file. The default is FeC2.log
  <DDL timeout>     : time-out value in microseconds for DDL commands. The default is 100000.
  <mem offset>      : offset in physmem memory in MBs, default: 0.
  <mem size>        : utilizable physmem memory in MBs, default: 8.
  -s                : use shared memory for file storage.
  -v                : verbose mode.
  -h                : prints a short help and stops.

The aim of the program:

The program is designed for controlling and configurating the ALICE Front-end Electronics via the DDL. It can download FEE commands and data blocks and can read FEE status and data. The user can compose his task by a simple script file.

The data blocks to be downloaded has to be written into files beforehand. It can happen that the same file has to be downloaded several times during the same run of the program or at diferent times. To accelerate the file handling there is a possibility to store the files into shared memory segments. If one calls the program with the -s switch, the program tries to store each files into shared memory, so for the next use of the file it will be retrieved from memory instead of the file.

Limitations:

There exists a small program for cleaning the shared memories in a channel-by-channel way:
> clean_shm [-m <minor>] [-c <channel>] [-x]
In case of -x, the program scans the shared memories and does not remove them.


Instructions used in the script file:

The commands and parameters can be separated by space(s) or tabulator(s).
Each command should be written in one line.
Any number of empty lines is allowed.
Lines starting with a "#", "*" or ";" character are considered as comment.
After ";" or "//" characters the remaining part of any line is considered as in-line comment.
Comment lines, in-line comments and empty lines can be used in data files as well.

A command consists of a key word and zero or some parameters. Any parameters of a command can be an environmental variable. If the variable is undefined the program stops after an error message. The variable can be referenced in one of the following forms: $<variable>, ${<variable>} or $(<variable>).

All the commands will be executed sequentially up the end of the script file, or until reaching a return/stop command, or till the occurrance of an error.

DDL related instructions:

reset [RORC | DIU | SIU]
    Action: resets the given part of the DDL link. If no parameter is given
            then the RORC card will be reset.

write_RDYRX
    Action: the RDYRX DDL command will be sent to the Front-end.

write_EOBTR
    Action: the EOBTR DDL command will be sent to the Front-end.

write_command <command code>
    where: <command code> is a hexadecimal number of maximum 19 bits.
    Action: a DDL command will be sent to the Front-end.

write_block <address> <file name> [<format>]
    where: <address>   is the front-end address (of maximum 19 bits)
                       where the block has to be sent to.
           <file name> is the name of the file where the data is.
           <format>    the C style format of reading a word from the file.
                       If missing binary file is supposed. 
    Action: first the address, then the block of data will 
            be sent to the Front-end.
    The length of the file should correspond to the length expected
    for the given address. The maximum length allowed is (2^19-1) words.

write_block_multiple <poll_address> <status> <mask> <timeout> <FEE_address> <block_size> <file name> [<format>]
    where: <poll_address> is the front-end address (of maximum 19 bits)
                          where the status read request has to be sent to.
                          The FEE changes this status when it is ready to
                          accept the next data block.
           <status>       is the expected reply sent by the Front_end
                          signaling the FEE is ready to accept the next
                          data block. (a 19 bit hexadecimal number)
           <mask>         will be AND-ed with the received value before
                          comparing against <status>.
           <timeout>      is the maximum time in microseconds while the
                          repeated status read is going on.
           <FEE_address>  is the front-end start address (of maximum 19 bits)
                          where the blocks have to be sent to.
           <block_size>   size of the data blocks (in words) to be sent in one 
                          DDL transaction.
           <file name>    is the name of the file where the data is.
           <format>       the C style format of reading a word from the
                          file. If missing binary file is supposed. 
    Action: The program reads the data from the given file and devides it
            into sub-blocks of <block_size> words length. For each block 
            it sends the FEE address and the block of data to the Front-end.
            Then it sends a status read command to the <Front-end pool_address>
            and compares the (reply & <mask>) with <status>. This will
            be repeated until exact match happens or the timeout is
            over. In the latter case the loop is stopped and "check_fail" flag 
            is set.
    The length of the file should correspond to the length expected
    for the given FEE address. The maximum length allowed is (2^19-1) words.

read_and_print <address> "<format>" [<stream>]
    where: <address> is the front-end address (of maximum 19 bits)       
                     where the status read request has to be sent to.
           <format>  the C style format for printing the read data.
           <stream>  the file name where to append the print.
                     If <stream> is missing: if a log file was defined
                     (see the calling sequence of FeC2) it will be used, 
                     if not the standard output or DATE infoLogger will
                     be used. 
    Action: a status read command will be sent to the Front_end and the
            received value will be printed according to the C style <format>
            into the <stream> stream. 

read_and_check <address> <status> <mask>
    where: <address> is the front-end address (of maximum 19 bits)       
                     where the status read request has to be sent.
           <status>  is the expected reply sent by the Front-end 
                     (a 19 bit hexadecimal number)
           <mask>    will be AND-ed with the received value before
                     comparing against <status>.
    Action: a status read command will be sent to the Front-end and the
            (reply & <mask>) will be compared with <status>. 
            If the comparison fails the "check_fail" flag is set. 

read_until <address> <status> <mask> <timeout>     
    where: <address> is the front-end address (of maximum 19 bits)       
                     where the status read request has to be sent to.
           <status>  is the expected reply sent by the Front_end 
                     (a 19 bit hexadecimal number)
           <mask>    will be AND-ed with the received value before
                     comparing against <status>.
           <timeout> is the maximum time in microseconds while the 
                     repeated status read is going on.
    Action: a status read command will be sent to the Front-end and the
            (reply & <mask>) will be compared with <status>. This will
            be repeated until exact match happens or the timeout is
            over. In the latter case the "check_fail" flag is set. 

read_block <address> <file_name> [<format>]
    where: <address>   is the front-end address (of maximum 19 bits)
                       where the block has to be read from.
           <file name> is the name of the file where the data has
                       to be written to.
           <format>    the C style format of writing a word into the file.
                       If missing, binary file will be written.
    Action: first the address will be sent, then a block of data
            will be read and written to the file. The length of the
            block is under the control of the Front-end.

read_and_check_block <address> <file_name> [<format>]
    where: <address>   is the front-end address (of maximum 19 bits)
                       where the block has to be read from.
           <file name> is the name of the file which containing
                       the data to compare with.
           <format>    the C style format of reading a word from the file.
                       If missing binary file is supposed. 
    Action: first the address, will be sent, then a block of data
            will be read and compare with the data in the file. 
            The length of the block is under the control of the Front-end.
            If the comparison fails the "check_fail" flag is set. 

Program flow related commands:

define <name> <value>
    Action: Whenever the <name> occurs as a command parameter 
            the <value> will be used instead. 
    The definition of <name> must be before its first use.
    To distinguish <name> and numbers the <name> must start 
    with a letter while hexa constants must start with 0x.

wait <usecs>
    Action: The execution of the program is suspended for the given number
            of microseconds. 

call <file_name>
    Action: The execution will jump to another script file, if file is
            found, else: stop processing. Recursive calls are not allowed.

return
    Action: terminate the processing of the current script and return
            to one level higher (or stop in the highest level).

stop_if_failed [<exit_code>]
    Action: if a previous check (write_block_multiple, read_and_check, read_until, or
            read_and_check_block instruction) fails the command processing
            will be stopped with the given or with 1 exit code.

stop [<exit_code>]
    Action: terminate the command processing with the given or 0 exit code.


Back to the RORC Documentation Page