This is version 1.11 of the SVT teststand software. The code has run on : - Solaris + MVME1604 with VxWorks 5.2 at LBL - DEC-Alpha + MVME147 with VxWorks 5.2 from SunOS at UCSB - DEC-Alpha + MVME1604 with VxWorks 5.3 from SunOS at UCSB - Linux + MVME1604 with VxWorks 5.3 from SunOS at UCSB - AIX + MVME1604 with VxWorks 5.3.1 from HP at INFN-Pisa - Solaris + MVME1604 with VxWorks 5.3.? using UCSB server at SLAC. However, while the code runs correctly on a MVME147, a hardware problem with the VME interface on the DAQ board causes the system to be very unreliable on a MVME147. The higher speed of the MVME1604 *hides* this problem, and the system works very well with the 1604. The performance of the system with a VME167 (faster than the 147, but slower than the 1604) is not known. ***************************************************************** ***************************************************************** ***** MAKE SURE YOU READ THE CUSTOMIZATION SECTION CAREFULLY **** ***************************************************************** ***************************************************************** DATES OF RELEASES ----------------- Version 0.1 7 September 1996 Version 0.2 24 September 1996 Version 0.3 4 November 1996 Version 0.4 31 January 1997 Version 0.5 13 March 1997 Version 0.5.1 7 April 1997 Version 0.6 19 May 1997 Version 0.7 27 July 1997 Version 1.0 6 February 1998 Version 1.02 10 April 1998 Version 1.10 10 May 1998 Version 1.11 10 June 1998 CHANGES VERSION 1.11 vs 1.10 ============================ - Fixed a bug in loop tests that prevented the top and bottom half of the HDI from being tested separately. (Bug was introduced in Version 1.10) - Fixed a bug in loop tests. When selecting individual chips to test, the rightmost chip was skipped. (Bug introduced in Version 1.00) - Fixed a bug in loop tests: clock B was never selected CHANGES VERSION 1.10 vs 1.02 =========================== - can now ignore chips in calibration runs - customization mods from Lusiani and Hast - C.Hast has modified Alberto's GNUmakefiles to work with the oasis_new software at percheron at SLAC. These are GNUmakefile_slac and GnuMakefile-body_slac. If you use the calibration software on this machine please do a "source rc.config" first to set up all needed variables. CHANGES VERSION 1.02 vs 1.01 =========================== - Added configurable skip to TOT tests - Fixed bug on TOT tests CHANGES VERSION 1.01 vs 1.0 (This version was never officially released) ======================================================================== - Removed trailer test when reading registers - Format checks are now configurable - Add date, runnumber, and part name to output files for misc. tests - Add format check to misc. tests - Add inquiry for part_name to misc. tests - Ask user to authomatically run quickfit at the end of a scan CHANGES VERSION 1.0 vs 0.7 ========================= - Added a bunch of miscellaneous tests. The test for shorts is now part of this suite of tests. Go to the "miscellaneous tests" window and click on the HELP button for details. IMPORTANT: need to add misc_testsCmd.o to the list of files to be compiled under UNIX in your existing Makefile - Added a "part name" variable. When you bring up the program, you will be asked for the part name ("part_name"). The output files from "threshold/charge" scans and also for "miscellaneous tests" will go into a subdirectory data_directory/part_name (See Customizations Section, item (4)) - "data_directory" is now read in from the environmental variable DATA_DIR (See Customizations Section, item (4)) - We can now fire any number of channels between 1 and 128 at a time in threshold/charge scans. It used to be either 1 or 128. - The histograms of threshold/charge injection are now booked from -0.5 to 63.5 rather than 0 to 64. This is so that the actual DAC value is at the center of the bin and the parameters from hbook fits are not biased by 0.5 counts. - At the end of threshold/charge scans, the hbook file is now authomatically generated from the histoscope file. This saves entering commands from the shell. For this to work, the "tohbook" program, available from the histoscope distribution, should be in your PATH. - The format of the file where the settings are stored has changed. The old formats are still recognized. - A bug in the compressed output file format for charge injection/threshold scans has been fixed. This bug occurs only from chips read to the right. The code to read this file, available from http://charm.physics.ucsb.edu/BaBar/tstand.html is able to handle this problem. The number of chips on the top of the hybrid is now also stored in one of the previously unused bytes of this file (see oasis_new/cal_data_format.txt) - An artificial delay has been added to eventseq.c to fix a bug which occurs when we are using more than one buffer. - When setting up the control registers for all chips simultaneously, do not change the readout direction unless explicitely told to do so. - When reading registers and masks, check the expected data channel first. (Used to be, check data_left first regardless of expectations). - During looped tests, the 1st time we look at a chip, report the channel on which the data is found. - Fixed a bug in cal_dump.c (right and left where switched) - Fixed some compilation errors on AIX. - Fixed bug in suspend/resume for charge scan (threshold scan was ok). - Added switch for site = FERMI2. - Fixed intger overflow in oasis_new/tcl/pmcom.tcl (it was ok on alpha). CHANGES VERSION 0.7 vs 0.6 ========================== - In the LBL setup, it was found necessary to add an extra delay in oasis_new/src/front/eventseq.c. Since this does not appear to be needed in the UCSB and/or Pisa setups, it is now commented out. (See customization section) - Added a "tot to charge" conversion routine. This is very preliminary. For the moment it works only at UCSB. It is ONLY used to fill a histogram for LED scans. Since LED scans are only done at UCSB (so far), this should not matter to anyone else. - Faster performance of "Looped tests". Guess readout direction the first time, instead of always checking first from the left and then from the right. - The "Test for Shorts" procedure now outputs a list of "bad" channels to the screen and saves this list to the file "short_summary.txt" - For xy scan, the bit in the begin run record was not being written. This has now been fixed. - When setting up parameters for all chips, ask the user whether the masks should also be set up in a global way (this used to be the default). - Added new feature which allows to set the masks in a fully graphical way. - Make handling of UCSB motors more convenient. They LED can now be moved "by hand" during a run, while suspended. Hopefully, this should be helpful in debugging mode. - Added a "move-to-channel" feature to UCSB motor window CHANGES VERSION 0.6 vs 0.5.1 ============================= - Moved some functionality Unix --> VxWorks to gain speed. IMPORTANT: need to add "eventseq.o" to list of files to be compiled under vxworks. Also, you will need to rerun rpcgen.new (if this is not done authomatically by your makefile). - A. Lusiani working at the testbeam has reported hangs of the DAQ board during normal data taking which can be fixed by adding a delay in the data acquisition routine through a dummy "for loop". No such hangs have been seen at UCSB, so the necessary code is commented out. If you experience the problem, you should try to uncomment out the relevant piece of code in oasis_new/src/front/eventseq.c. See customization section. - A similar problem has been experienced at UCSB in a new routine which is only used in the one_at_a_time loop. A fix has been implemented by adding a dummy for loop. If you experience hangs in the "one_at_a_time" scans, and nowhere else, you could try to make the dummy loop in the function vmePmCommandAll (file oasis_new/src/front/unmpre.c) longer. (Also, please let me know for future reference). If the problem does not go away, email claudio@muon.physics.ucsb.edu and I'll give you a workaround. - Improved Send_Command window (from A. Lusiani). Further improvements by Claudio C. - Fixed bug in cal_dump.c for dump of chip number 10 - Revamped (?) the test for shorts stuff - Added a "memory" feature to the talk_to_histoscope menu - Changed order of parameters in vmevmebuffread (as per A. Lusiani request) - Added board reset ("daq_0(brd_reset)") to list of registers defined in the vme_teststand window CHANGES VERSION 0.5.1 vs 0.5 ============================ - Include customizations from Pisa/Milano - Fixed incorrect handling of runnumber when aborting a run - Fixed incorrect writing out of masks for one channel at a time option - Fixed problem with reading out control registers and masks from the right MAIN CHANGES VERSION 0.5 vs 0.4 =============================== - Need to add "cal_decode_chip.o" to list of files to be linked under UNIX. - Fixed a bug in the treatment of corrupted headers for hybrids with > 1 chip. - Added more checks of data format integrity. - When setting up hybrid, send MASTER RESET in broadcast mode. It used to be sent only to chip address zero, and as a result the trigger time stamp was different for chips with address zero. - Add an option to do charge injection and threshold scans one channel at a time. - The option above forced the modification of (1) Format of output file. The output file format is kept in oasis_new/cal_data_format.txt. Note that there are now two formats, a "standard" and a "compressed" format. (2) Format of files with stored defaults. To update existing default files to the new format, add two lines with a "0" at the beginning of each old defaults file. - Fixed a bug that crept in who-knows-when in "Tests for Shorts" procedure. - In "Test for Shorts" procedure, it is now possible to use different values of the charge injection DAC (Cal-DAC) on the two sides of the HDI. - Added a second 2d plot histoscope of threshold vs channel number. The original one was ID=500 and is filled on every event. The new one has ID=501 and is filled only for channels that have both calibration and channel masks on. MAIN CHANGES VERSION 0.4 vs 0.3 =============================== A large number of changes were made. Here is a (partial?) list. - Fixed MAJOR bug in reading data from more than one personality module channel. - Enable larger wordcount (up to 0x800 words). - A problem has been discovered related to the timeout. When a timeout occurs the daq board can get stuck in a state where things do not work anymore. This is not understood. A software fix as been implemented. - Hardware chip addresses now start at 0. They used to start at 1. This is because that is how the hybrids from Milan are setup. - Added support for hybrids loaded with different number of chips on the top and bottom. - Added XY scan support. Even if you do not plan to do XY scans at your site, you need to read the customization section carefully. Also, if you already have a working Makefile, you should add "cal_xy_stage.o" to the list of files to be compiled and linked under unix. - Provisions have been made to include XY scan information in the output data file. See oasis_new/cal_helpfile. To keep backward compatibility, the format is identical to the old one if no XY scan is performed (i.e. for charge injection and/or threshold scan runs). This is not optimal, because there is no switch in the data stream to distinguish between different types of run. Effectively you have to know what kind of run you are analyzing when reading back a data file. This may change in a coming release. - There is a (known ?) intermittent problem with correctly reading back bit 127 of channel mask (this is the last bit transmitted by the chip when a read-register command is issued). This problem causes a slew of error messages when performing looped tests from the "Register" window. To suppress these error messages, there is now a button in the "Register Tests" window. - In reading back registers, both possible personality module channels are checked for the presence of data with the appropriate format. (This has not changed from the previous version). It is necessary to do this because in principle one does not know whether the data will be returned on the right or on the left. It has happened that data in VRAM from the wrong channel just happened to have the right format. This causes nonsensical results. There is no clean way of getting around this problem, short of specifying ahead of time what channel we expect to get data on. In order to at least be able to diagnose this problem when it occurs, when a Read command is issued from the "Register Tests" window, the personality channel number on which data was found is now reported at the bottom of the window. - In calibration runs, the run number is now "bumped up" when EITHER a data file is being written OR when histoscope is enabled (or both). This used to happen only when the data file was being written. - The histoscope output file name has been changed from "histoscope.out" to "histoscope_XX.out", where XX is the runnumber. This file used to be written out to the working directory. It is now written out to a user-configured directory. See customization section - The parameters for the a calibration run are now routinely written out to a file. This then allows you to load the parameters from a previous run by just specifying the runnumber ("Calibration Window", "Load Defaults" button). - The UCSB XY motor control code has been modified to work with the MVME1604. - Buttons have been added to the chip-menu window to facilitate global changes in calibration and channel masks. - For the "All CHIPS" chip-menu window, a facility has been added in the case of two sided hybrids to set the charge injection in a consistent way (since the charge injection is positive logic on one side, and negative logic on the other side). When you click "OK" to accept the changes that you have made you will be asked whether you want to change the charge injection parameters in a global way for one of the two sides. MAIN CHANGES VERSION 0.3 vs 0.2 =============================== - Added interactive booking/zeroing/deleting of histogram - Enable larger wordcount (up to 0x300 words). - Minor misc. bug fixes MAIN CHANGES VERSION 0.2 vs 0.1 =============================== - Fixed bug in bit ordering of TOT at 'time stamp'. - Accounted for the fact that TOT and 'time stamp' are gray code. - The `trigger jitter` is now inputted as decimal, and converted to grey code authomatically. WHAT IS IN THIS DISTRIBUTION ============================ The distribution includes : - This README file - *.c and *.h files for both unix and vxworks - *.tcl files for unix - *.x files for RPCGEN. But you should not need to mess with RPCGEN. - *.d (dependency files). These are generated by the makefile. You can delete them and regenerate them from scratch, if you wish. - A number of files that are used by the tcl script, i.e. oasis_new/tcl/babar1.xbm : a bitmap picture of babar oasis_new/cal_defaults.store : default settings for charge injection, etc etc etc oasis_new/*helpfile : a bunch of help-files that you can display from the tcl script oasis_new/runnumber : a file that contains the current runnumber for runs writtten to disk - oasis_new/bin/test_1604.o. This is the VxWorks 5.3 object as compiled at UCSB. If you do not want to compile your own, or if you cannot compile it because you do not have a developer license or you do not have a compiler, you can try using it. You have to be careful about compilation dates however. The mechanism to insure that the server and the client are in synch is based on keeping track of the compilation dates. This is handled authomatically by the makefile. If you try to use the precompiled test_1604.o, chances are that you will get an error due to the different dates for the client and the server as soon as you first hit the initialize button. To get around this error, you need to perform the following kludge : (a) restart "cwish" but this time enable the "debugging" option from the main window BEFORE you hit the initialize button (b) After you hit the initialize button, you will also get an error message on the VxWorks console. This error message will report the different dates of the client and the server. Make a note of these dates. (c) Edit at oasis_new/temp/server_date.c ; this file should look something like this /* this file generated by the Makefile; do not edit */ const char* VME_ServerCompileDate = "Thu Feb 5 14:29:25 PST 1998"; Hopefully the date in this file should be one of the two dates reported in the VxWorks console, see (b) above. Change the date in this file to be IDENTICAL to the other date from the VxWorks console. Then compile/link cwish (i.e. the Unix client) again. Make sure that the makefile does not change oasis_new/temp/server_date.c underneath you again ! If it does, kludge it so that it does not. PS sorry if this is a mess. I guess the system was not designed to use a server compiled somewhere else. (I did not write this part of the code !!!! CC). - oasis_new/cal_data_format.txt. This contains a description of the output file format. - oasis_new/makefile_linux. This is a makefile that works on linux and should also work for any other OS. This makefile only handles the UNIX part (since you cannot use Linux to compile VxWorks code). - oasis_new/makefile_lbl. This is the makefile used at LBL (VERY OLD NOW). - oasis_new/GNUmakefile_pisa and oasis_new/GNUmakefile-body_pisa; these are the makefiles used in Pisa for AIX and HP-UX (AGAIN, VERY OLD) - oasis_new/GNUmakefile_slac and oasis_new/GNUmakefile-body_slac; these are recent Makefiles prepared by Carsten Hast for slac setup. - oasis_new/rc.config_slac (if you use the slac GNUmakefiles, do $source rc.config_slac to setup some variables needed by the GNUmakefiles. CUSTOMIZATIONS ============== This is a list of files that you need to change to customize the package to your environment. In many (but not all) cases, the changes can be made permanent via site-dependent switches, see below. In that case, please send your modifications to claudio@muon.physics.ucsb.edu, they will be incorporated in the next release and you will not have to go through the full customization process for the next release. (1) makefile the makefile for the LBL installation is oasis_new/makefile_lbl. You will need to change it for your setup. If you already have a working makefile, and if you are upgrading from an older version you will have to add some files to the list of files to be compiled under unix or vxworks : (a) if you upgrade from a 0.3 distribution, add: cal_xy_stage.o, cal_decode_chip.o ----- under unix misc_testsCmd.o ----- under unix eventseq.o ----- under vxworks (b) if you upgrade from a 0.4 distribution, add: cal_decode_chip.o, misc_testsCmd.o ----- under unix eventseq.o ----- under vxworks (c) if you upgrade from a 0.5 distribution, add: misc_testsCmd.o ----- under unix eventseq.o ----- under vxworks (d) if you upgrade from a 0.6 or 0.7 distribution, add: misc_testsCmd.o ----- under unix (2) oasis_new/src/front/vmemap.h This header file contains the shift needed to go from processor memory to VME space. For 68k computers (e.g. MVME147, MVME167), this parameter is zero. For PowerPc computers, (e.g. MVME 1604) this parameter is user-configured, and is defined when the VxWorks OS is compiled. See the "VxWorks 5.2 Programmer's Guide" Section 8.3. Therefore you need to edit this one-line header file for your configuration. In the old UCSB setup (MVME147) this is : #define MAPSHIFT 0x00000000 In the LBL setup and the new UCSB setup (MVME1604) : #define MAPSHIFT 0xd0000000 (but as mentioned above this depends on how your VxWorks OS was compiled.......). Also, both 68k and PowerPc user should make sure that the full range of addresses of the VME card(s) in their system is accessible from VME. For example, the default MVME147 VxWorks 5.2 installation at UCSB had only 32 Mbytes of VME space that were accessible. The LBL DAQ card spans 112 Mbytes of address space (I think). This is configured when the OS is compiled. More memory can be defined by adding entries to the sysPhysMemDesc structure in $(VX_VW_BASE)/config/???/sysLib.c. (Again, see Section 8.3 of the "VxWorks Programmer's Guide"). Also, there is a "rumor" that the entries in this structure cannot be more than 32 Mbyte. If you need more address space (and you do), add a number of entries to cover your needs. (I think this limitation does not hold for PowerPC). Then, you have to recompile VxWorks. See the "VxWorks 5.2 Programmer's Guide", Section 10.4. (Actually, in the UCSB case we had to fiddle with the makefile to make it work). (4) oasis_new/tcl/site.tcl This file defines two global tcl variables that are site-dependent, "site" and "data_directory". The first is a switch that can be used in the tcl code. The second is the name of the directory where the run-data files and the histoscope-files are to be written. Starting from version 1.0, these files go in the directory data_directory/part_name, and data_directory is taken from the environmental variable DATA_DIR. Note the directory for the data file, as well as its name, can be changed interactively from the "Calibration" window. At the moment this is not possible for the histoscope file. (5) oasis_new/tcl/cwish.tcl Use the "site" variable to define the path for the babar logo (babar1.xbm). Take a look at the code, it should be obvious what to do. Send the modified file to claudio@muon.physics.ucsb.edu. (6) oasis_new/tcl/xy_allowed_sites.tcl If you plan to do XY scans at your site, add your site to this file. Send the modified file to claudio@muon.physics.ucsb.edu. (7) oasis_new/src/cal/site.h This header file contains the name of your site. It is used to enable/disable compilation of chunks of C-code which are site dependent. You must modify this with the name of your site. (8) oasis_new/src/cal/cal_xy_stage.c This contains the needed commands to move the XY stage. Look at the comments at the top of the file. YOU WILL NEED TO CUSTOMIZE THIS FILE EVEN IF YOU DO NOT PLAN TO DO XY SCANS. Send your modified file to claudio@muon.physics.ucsb.edu. At the moment the code nows about the following sites: UCSB SUNBABAR LBL FERMI2, (9) RPC support in VxWorks This is not a customization per se, but make sure that your OS was compiled with RPC enabled (the system at UCSB was not !). To enable RPC, edit $(VX_VW_BASE)/config/all/configAll.h and move the line with "#define INCLUDE_RPC" to someplace where it actually gets defined. Then, you have to recompile VxWorks. (10) oasis_new/tcl/hardware.tcl Modify this file, using your predefined TCL "site" variable (see item (4) above) to specify the address of the daq board in your setup (and to define other vme boards, if you like). (11) oasis_new/src/front/eventseq.c Artificial delays have been found to be necessary in this VxWorks routine in some setups (Pisa, LBL), but not in others (UCSB). The delays have been implemented by dummy "for loops". It is not clear why they are needed in some setups and not in others. AS A DEFAULT, THESE DELAYS HAVE BEEN COMMENTED OUT. YOU SHOULD UNCOMMENT IT FROM THE CODE IF YOU WANT TO INCLUDE THEM. (12) oasis_new/src/cal/misc_testsCmd.c The time stamp test introduced in version 1.0 includes a change in the delay of the L1ACCEPT w.r.t CAL_STROBE signal that needs to occurr halfway into the test. At the moment, for sites which are not UCSB, the program prompts the user to make this hardware change before continuing. If you have a way to control this hardware change from software, modify the function "misc_switch_time" using your site macro switch, see item (7). This is already done for UCSB, so use that as a template. Then send your modified code to claudio@muon.physics.ucsb.edu for inclusion in the next release. (13) Make sure that the "tohbook" program, available in the histoscope distribution, is in your PATH. HOW TO RUN THE PROGRAM ====================== (1) Load the VxWorks object file. From the VxWorks prompt -> cd "/xxx/oasis_new" -> ld < test.o (where xxx is the path upstream of oasis_new in your installation) (2) Start the VxWorks server (as a spawned process here, but you can just run it if you prefer) -> sp vmeServerBegin (3) Start the Unix process % setenv DISPLAY xxxx:0.0 % cd oasis_new % bin/cwish (4) Hit the initialize button (5) Some of the windows have "Help" buttons. That's a good place to start. QUESTIONS AND BUG REPORTS ========================== To claudio@muon.physics.ucsb.edu