29
Control software M. Sozzi Pisa - January 30/31, 2014

Control software

  • Upload
    farrah

  • View
    42

  • Download
    0

Embed Size (px)

DESCRIPTION

Control software. M. Sozzi Pisa - January 30/31, 2014. Mainz 2011. Software. The firmware is to be controlled – initialized – monitored from the CCPC (access during data taking possible) Use only low-level libraries from LHCb (JTAG, glue, I2C, …) with frozen source code - PowerPoint PPT Presentation

Citation preview

Page 1: Control software

Control software

M. SozziPisa - January 30/31, 2014

Page 2: Control software

• The firmware is to be controlled – initialized – monitored from the CCPC (access during data taking possible)• Use only low-level libraries from LHCb (JTAG, glue, I2C, …) with frozen source code• Command-line control program (with scripting and macros) made available by Pisa: - tightly linked to firmware version- to be customized for sub-detector firmware versions- to be used both for test/monitoring and real data-taking- initialization via XML files • Scientific Linux version: to be frozen

• TEL62 firmware loading requires JAM-file player: existing LHCb version not working: to be solved – Perugia

SoftwareMainz 2011

Page 3: Control software

Low-level librariesi2clib.c

gluelib.c

lblib.c

fproglib.c

jtaglib.c

jamlib.c

I2C handling (LHCb)

Glue card handling (LHCb)

Local bus handling (LHCb)

EPROM programming (LHCb) → NA62 modified

JTAG handling (LHCb) → NA62 modified

JAM file handling (LHCb) → NA62 modified

JBI file handling (LHCb) → NA62 modified

Futex implementation (CERN)

jbilib.c

exclulib.c

Page 4: Control software

Low-level commandsSome standalone (LHCb-provided) utilities are installed together with the libraries, such as:

lbread <address>lbwrite <address> <value>for writing to TEL62 local bus (e.g. FPGAs)

jtagscanto identify JTAG devices on TEL62

EPC16Handlingto load a firmware (pof) file (on TELL1 EEPROM only)

Page 5: Control software

tel62.h

tel62lib.c

tdc.h

tdclib.c

tel62tab.c tdctab.c

td.h

tdlib.c tdspy.c

tdmsgdef.ctdspycom.h

tdspytab.c

tdspyreq.c

tdtab.c

tdtabcomplete.c

tdsys.h

tdspy.h

tdxml.h

tdspyreq.h

tdspycomlib.c

tdsyslib.c

tdxmllib.c

tdcode software suite (NA62)

Completely written in standard C~44K lines of code

Page 6: Control software

tel62.h

tel62lib.c

tdc.h

tdclib.c

tel62tab.c tdctab.c

td.h

tdlib.c tdspy.c

tdmsgdef.ctdspycom.h

tdspytab.c

tdspyreq.c

tdtab.c

tdtabcomplete.c

tdsys.h

tdspy.h

tdxml.h

tdspyreq.h

tdspycomlib.c

tdsyslib.c

tdxmllib.c

tdcode software suite (NA62)

Completely written in standard C~44K lines of code

Core functions

Page 7: Control software

tel62.h

tel62lib.c

tdc.h

tdclib.c

tel62tab.c tdctab.c

td.h

tdlib.c tdspy.c

tdmsgdef.ctdspycom.h

tdspytab.c

tdspyreq.c

tdtab.c

tdtabcomplete.c

tdsys.h

tdspy.h

tdxml.h

tdspyreq.h

tdspycomlib.c

tdsyslib.c

tdxmllib.c

tdcode software suite (NA62)

Completely written in standard C~44K lines of code

TEL62 boardspecific code

TDC boardspecific code

Page 8: Control software

tel62.h

tel62lib.c

tdc.h

tdclib.c

tel62tab.c tdctab.c

td.h

tdlib.c tdspy.c

tdmsgdef.ctdspycom.h

tdspytab.c

tdspyreq.c

tdtab.c

tdtabcomplete.c

tdsys.h

tdspy.h

tdxml.h

tdspyreq.h

tdspycomlib.c

tdsyslib.c

tdxmllib.c

tdcode software suite (NA62)

Completely written in standard C~44K lines of code System

(TEL62+TDCB)functions

Page 9: Control software

tel62.h

tel62lib.c

tdc.h

tdclib.c

tel62tab.c tdctab.c

td.h

tdlib.c tdspy.c

tdmsgdef.ctdspycom.h

tdspytab.c

tdspyreq.c

tdtab.c

tdtabcomplete.c

tdsys.h

tdspy.h

tdxml.h

tdspyreq.h

tdspycomlib.c

tdsyslib.c

tdxmllib.c

tdcode software suite (NA62)

Completely written in standard C~44K lines of code

TDSPY interactive program code

Page 10: Control software

tel62.h

tel62lib.c

tdc.h

tdclib.c

tel62tab.c tdctab.c

td.h

tdlib.c tdspy.c

tdmsgdef.ctdspycom.h

tdspytab.c

tdspyreq.c

tdtab.c

tdtabcomplete.c

tdsys.h

tdspy.h

tdxml.h

tdspyreq.h

tdspycomlib.c

tdsyslib.c

tdxmllib.c

tdcode software suite (NA62)

Completely written in standard C~44K lines of code

TDSPY default printout functions

Page 11: Control software

tel62.h

tel62lib.c

tdc.h

tdclib.c

tel62tab.c tdctab.c

td.h

tdlib.c tdspy.c

tdmsgdef.ctdspycom.h

tdspytab.c

tdspyreq.c

tdtab.c

tdtabcomplete.c

tdsys.h

tdspy.h

tdxml.h

tdspyreq.h

tdspycomlib.c

tdsyslib.c

tdxmllib.c

tdcode software suite (NA62)

Completely written in standard C~44K lines of code

TDSPY remote control code

Page 12: Control software

tel62.h

tel62lib.c

tdc.h

tdclib.c

tel62tab.c tdctab.c

td.h

tdlib.c tdspy.c

tdmsgdef.ctdspycom.h

tdspytab.c

tdspyreq.c

tdtab.c

tdtabcomplete.c

tdsys.h

tdspy.h

tdxml.h

tdspyreq.h

tdspycomlib.c

tdsyslib.c

tdxmllib.c

tdcode software suite (NA62)

Completely written in standard C~44K lines of code

XML configuration code

Page 13: Control software

TDSPY is the interactive control program for the tdcode suiteCommand-line driven console program running on the TEL62 CCPC under Linux

No GUIQuite flexible control allowing- scripting- user macro definition- remote control

Some commands are tightly linked to the firmware versionIt still changes almost daily without any notice

TDSPY program

Page 14: Control software

Meant to be the unique access point to the hardware, for- board development- board testing- expert debugging- standard user control- hardware configuration and database interaction- operation during data-taking (under run control)

Tdspy use

tdspy

Runcontrol

Otherprocess

(ssh)

pipe/socket

DIM

Page 15: Control software

Na62tdaq repository @CERN contains:•TDCC firmware•TEL62 firmware•tdcode software suite w. scripts•some utilities

How to use it:•Create a CERN service account such as “na62to”, “na62bham”, etc.•Ask Pisa to create a new (empty) sub-detector firmware structure (if needed)•Ask [email protected] for access •(Read-)accessible from browser via WebSVN

SVN

Page 16: Control software

Compile on the server (much faster), currently SLC4

Current quirk (to be fixed): su chroot /opt/ccpc/root cd <directory> make chown cc:na62 tdspy

prompt>tdspyFloating point exception

→ You did not do the above

Compilation

Page 17: Control software

[tel62-10] /home> tdspy -h

TDSpy: TDAQ control programUsage: tdspy [-f<file>][-l<file>][-u<file>][-d [-b] [-o[<file>]] [-p[<pipe>]] [-s[<port>]]] -f : alternate startup file (default tdstart.spy) -l : alternate log file (default tdspy.log) -u : alternate users file (default tdspy.usr) -d : daemon mode -b : blocking (for daemon mode) -o : output file name (for daemon mode) -p : pipe mode and name (for daemon mode) -q : quiet mode (for daemon mode) -s : socket mode and port (for daemon mode)

Invocation

Page 18: Control software

[IDLE]TDSpy>help

Use help <command> for individual command usage.Use @<filename> for file input, ! for recall.A dot (.) terminates most interactive commands.In most commands 99 stands for ALLand a list such as n1,n2-n3 is allowed.Macro definitions need () and optional formal argumentsof the form %<letter>; definition ends with a dot line.

automask mask non-responsive daughter-cards boardinfo show TEL62 information boardinitialize reset and initialize TEL62 boardreload reload all TEL62 devices ...

Online help

Page 19: Control software

[IDLE]TDSpy>help ppwrite ppwrite <id> <tag> <val> [<nloc>] [<first>] write PP-FPGA register id: PP-FPGA id tag: PP-FPGA register val: Value (hex) nloc: Number of locations first: First location (hex)

Command (and register, memory, etc.) completion using <TAB>

Online command help

Page 20: Control software

The basic abstracted action is reading/writing into «registers»: - actual hardware registers- bit fields in hardware registers- FIFOs- memoriesThis can actually happen through the local bus, I2C (for registers in the TDCB), JTAG (for internal HPTDC registers), Intel bus (for GbE MAC registers) etc., with direct or indirect addressing, bit masking, single or multiple accesses etc. (all this is hidden from the user)

Most command names start with the target:e.g. ppwrite (PP-FPGA), slread (SL-FPGA), tdccstatus (TDC controller FPGA), tdcdump (TDC chip), ttcrxinfo (TTCrx chip), ddrtest (DDR memory), gbeinfo (GbE card), portmask (GbE port)Commands can have both mandatory and optional arguments (easy mode). 99 usually stands for “all” devices of a kind

Some tdspy concepts

Page 21: Control software

A single PP register

TDSPY>ppwrite 2 CONTROL 0x10TDSPY>ppwrite 2 FREEZE 1

Reserved means reserved!

Page 22: Control software

Some «setup» variables can change the way the program workssetup <variable> <value>e.g. verbose, debug (control level of printing), cwd (directory in which to look for files), echo (write commands to screen), log (log commands to a file)

A script file (ASCII text) can be executed with @<filename>

User macros (with variables) can be defined with macro <name>(a,b)

More tdspy concepts

Page 23: Control software

• automask• check• hello• setup• shell• tdccemudump• tdcdecode, ttcrxdecode• users

Some little known commands

Page 24: Control software

DIM (from run control):compile with –DDIMlaunch with –c <server name>send commands via DIM

Pipe/socket: launch with –d –s <port> (for socket)send commands by: - Using tdtalk standalone program - Using the API provided in tdspycom.h and tdspycomlib within your code

Remote communication

Page 25: Control software

Eventually all hardware should be configured through XML files (from online database)Common routines for XML file handling are under development:For each «object» (PP, TDC, etc.) one needs:- a routine to actually load constants to hardware- a routine to read constants from hardware (eventually generating a new XML file for the database)

Not ready yet

Hardware configuration

Page 26: Control software

• XML/configuration code• Default hardcoded init-start-end routines• Fix cross-compilation quirk• Prepare NA62 RPMs (w. NA62-improved JTAG libs)• Migrate to SLC5-6• More test functions• Hardware access locking during run• Hardware status reporting function (to run control)• User privilege levels• EOB data debugging functions• Burst report loop function• More automatic check functions• ...

Todo

Page 27: Control software

• Public standalone data reading PC program• Complete NA62-aware Wireshark module• ...

More todo

Page 28: Control software
Page 29: Control software