Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Control software M. Sozzi Pisa - January 30/31, 2014."— Presentation transcript:

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

2 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 Software Mainz 2011

3 Low-level libraries i2clib.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

4 Low-level commands Some standalone (LHCb-provided) utilities are installed together with the libraries, such as: lbread lbwrite for writing to TEL62 local bus (e.g. FPGAs) jtagscan to identify JTAG devices on TEL62 EPC16Handling to load a firmware (pof) file (on TELL1 EEPROM only)

5 tel62.h tel62lib.c tdc.h tdclib.c tel62tab.ctdctab.c td.h tdlib.c tdspy.c tdmsgdef.c tdspycom.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

6 tel62.h tel62lib.c tdc.h tdclib.c tel62tab.ctdctab.c td.h tdlib.c tdspy.c tdmsgdef.c tdspycom.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

7 tel62.h tel62lib.c tdc.h tdclib.c tel62tab.ctdctab.c td.h tdlib.c tdspy.c tdmsgdef.c tdspycom.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 board specific code TDC board specific code

8 tel62.h tel62lib.c tdc.h tdclib.c tel62tab.ctdctab.c td.h tdlib.c tdspy.c tdmsgdef.c tdspycom.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

9 tel62.h tel62lib.c tdc.h tdclib.c tel62tab.ctdctab.c td.h tdlib.c tdspy.c tdmsgdef.c tdspycom.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

10 tel62.h tel62lib.c tdc.h tdclib.c tel62tab.ctdctab.c td.h tdlib.c tdspy.c tdmsgdef.c tdspycom.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

11 tel62.h tel62lib.c tdc.h tdclib.c tel62tab.ctdctab.c td.h tdlib.c tdspy.c tdmsgdef.c tdspycom.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

12 tel62.h tel62lib.c tdc.h tdclib.c tel62tab.ctdctab.c td.h tdlib.c tdspy.c tdmsgdef.c tdspycom.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

13 TDSPY is the interactive control program for the tdcode suite Command-line driven console program running on the TEL62 CCPC under Linux No GUI Quite flexible control allowing - scripting - user macro definition - remote control Some commands are tightly linked to the firmware version It still changes almost daily without any notice TDSPY program

14 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 Run control Other process (ssh) pipe/socket DIM

15 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 na62tdaq@cern.ch for access (Read-)accessible from browser via WebSVN SVN

16 Compile on the server (much faster), currently SLC4 Current quirk (to be fixed): su chroot /opt/ccpc/root cd make chown cc:na62 tdspy prompt>tdspy Floating point exception → You did not do the above Compilation

17 [tel62-10] /home> tdspy -h TDSpy: TDAQ control program Usage: tdspy [-f ][-l ][-u ][-d [-b] [-o[ ]] [-p[ ]] [-s[ ]]] -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

18 [IDLE]TDSpy>help Use help for individual command usage. Use @ for file input, ! for recall. A dot (.) terminates most interactive commands. In most commands 99 stands for ALL and a list such as n1,n2-n3 is allowed. Macro definitions need () and optional formal arguments of the form % ; 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

19 [IDLE]TDSpy>help ppwrite ppwrite [ ] [ ] 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 Online command help

20 The basic abstracted action is reading/writing into «registers»: - actual hardware registers - bit fields in hardware registers - FIFOs - memories This 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

21 A single PP register TDSPY>ppwrite 2 CONTROL 0x10 TDSPY>ppwrite 2 FREEZE 1 Reserved means reserved!

22 Some «setup» variables can change the way the program works setup 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 @ User macros (with variables) can be defined with macro (a,b) More tdspy concepts

23 automask check hello setup shell tdccemudump tdcdecode, ttcrxdecode users Some little known commands

24 DIM (from run control): compile with –DDIM launch with –c send commands via DIM Pipe/socket: launch with –d –s (for socket) send commands by: - Using tdtalk standalone program - Using the API provided in tdspycom.h and tdspycomlib within your code Remote communication

25 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

26 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

27 Public standalone data reading PC program Complete NA62-aware Wireshark module... More todo

28

29


Download ppt "Control software M. Sozzi Pisa - January 30/31, 2014."

Similar presentations


Ads by Google