1 Introduction
2 VME64x in CMS
3 VMEBridges
3.1 CAEN
3.1.1 Technical Info
3.1.2 Status
3.1.3 Software
3.1.4 Firmware
3.1.5 Measurements
3.2 SBS
3.2.1 Drivers
3.2.2 Old Drivers (SLC3)
3.2.3 Measurements
Link to the CAEN pages: http://www.caen.it/nuclear/product.php?mod=V2718
Supply voltage | current | remark |
5V | 1A | ongoing data transfers |
5V | 0.8A | no VME activity |
-12V | 150mA | All Lemo outputs configured for NIM and driving |
-12V | 40mA | Lemo outputs inactive or configured for TTL levels |
12V | 0mA | Connected but not used. |
The optical and the USB versions of the module are available and functional. They have been tested with the HAL library which contains full support of the modules.
The software is the original unmodified driver and library from CAEN. For CMS they have been packed into an rpm. The kernel module of the driver is contained in a separate binary and source rpm. Only the binary rpm for the kernel used in the experiment is given. But with the source rpm you can easily build you own binary rpm according to the instructions below.
Beware that CMS is NOT using necessarily the latest version of the CAEN software/firmware. Once we have a working setup we will not touch it until we will change our hardware or we find a compelling reason to upgrade.
The software is included in the CMS online software. It can be downloaded or installed via the yum repositories which can be found under
http://xdaq.web.cern.ch/xdaq/repo/
Relevant RPMs for the bridges with an optical link are called (names given without version numbers):
Limits: At maximum 8MB block transfers can be made.
rpmbuild --rebuild {rpm_name}-{version}.src.rpmYou will obtain binary RPMs in the directory below
/usr/src/redhat/RPMS/...
The library is installed in /opt/xdaq/lib. The firmware upgrade utility is installed in /opt/xdaq/bin/CAENVMEUpgrade. The include files are installed in /opt/xdaq/include. In addition a service named "caenvme" is created in /etc/init.d. The service is activated with the chkconfig utility so that the driver will be loaded automatically at every reboot. If you do not want to reboot your machine after the first installation just type as superuser:
/sbin/service caenvme start
The software documentation you find on the CAEN www side.
Here is the firmware currently used in CMS for the CAEN VME bridges. Note that the firmware for the VME Module are the same for the V1718 and the V2718.
In case you have a system which still runs the CONET 1 protocol on the fiber, be sure that you follow the steps in the CAEN Application Note for CONET 1 to CONET 2 migration.
A mini utility in order to read out the firmware versions from your optical bridge module can be downloaded here: caen-miniutils.tgz. Look into the code and change it to fit your needs. Also contained is a mini program using the HAL, in order to read out the display of the VMEController via the a3818. This is useful for debugging. The tgz file contain sources, a compile scritp and executables compiled on an SLC6 XDAQ12 machine.
General Remark:
In the CMS production system in point 5 we use only the a3818 boards running CONET 2 to our VME bridges in the VME crate. It is important that you use the latest firmware versions listed on this page, since they contain important fixes of bugs which various of our collaborators have found in previous versions of the firmware.
The firmware for the USB version of the VME adapter card is the same as the one for the optical version V2718 (see release notes and documentation of CAEN).
A new version of the firmware is not necessarily compatible with an old version of the software.
When you upgrade the firmware of your board(s) be sure to do the upgrade with the software (= driver + library) which you have currently installed. If the firmware upgrade requires a software upgrade the software upgrade MUST BE done AFTER the firmware upgrade.
The firmware upgrade utility you can find in the installation directory of the cms online executives:/opt/xdaq/bin/CAENVMEUpgrade
Modules with old Controller-firmware
If your module is equiped with a very old firmware (for example rev. 05 for the V1718vub firmware) and in addition for some reason your standard firmware has been corrupted during a firmware update, you could encounter problems to recover, due to a firmware bug. The following recipe allows you to recover the standard firmware of the module:
A measurement with the usb version of the CAEN Bridge (Model V2718_Kit) cane be looked at here. (The measurement has been obtained with the firmware v1718vub_rev0.12.rbf for the V1718 board. The rest of the measurement conditions have been identical to those for the optical bridge.)
=============================================================================== ATTENTION ==> the measured time values do not measure the process time but the total time elapsed during the measurement (laboratory-time) So, in order to get meaningfull measurements, be sure not to have other active processes on your machine. =============================================================================== (TimeoutException) Timeout during polling the item "rwFlagMask" 1000ms have passed wheras the timeout has been set to 1000ms 3680000 polls have been carried out (HardwareDevice::pollItem) read r/w-item with full mask : 2.57833us read r/w-item with full mask and offset : 2.95839us write r/w-item with full mask : 2.99179us write r/w-item with full mask and offset : 3.42508us read r-item with full mask : 2.53569us read r-item with full mask and offset : 2.91862us write w-item with full mask : 2.66218us write w-item with full mask and offset: 3.07601us unmaskedRead r/w-item with full mask : 2.66056us unmaskedRead r/w-item with full mask and offset : 2.90977us unmaskedWrite r/w-item with full mask : 2.65765us unmaskedWrite r/w-item with full mask and offset : 2.92356us setBit r/w-item with 1bit mask : 3.26963us setBit r/w-item with 1bit mask and offset : 3.71627us resetBit r/w-item with 1bit mask : 3.26833us resetBit r/w-item with 1bit mask and offset : 3.69591us setBit w-item with 1bit mask : 2.95803us setBit w-item with 1bit mask and offset : 3.35657us resetBit w-item with 1bit mask : 2.85544us resetBit w-item with 1bit mask and offset : 3.37863us ===============================================================================
=============================================================================== ATTENTION ==> the measured time values do not measure the process time but the total time elapsed during the measurement (laboratory-time) So, in order to get meaningfull measurements, be sure not to have other active processes on your machine. =============================================================================== (TimeoutException) Timeout during polling the item "rwFlagMask" 1009ms have passed wheras the timeout has been set to 1000ms 100000 polls have been carried out (HardwareDevice::pollItem) read r/w-item with full mask : 14.2928us read r/w-item with full mask and offset : 14.7548us write r/w-item with full mask : 24.1194us write r/w-item with full mask and offset : 24.6097us read r-item with full mask : 14.1733us read r-item with full mask and offset : 14.7672us write w-item with full mask : 13.5404us write w-item with full mask and offset: 14.0083us unmaskedRead r/w-item with full mask : 14.1884us unmaskedRead r/w-item with full mask and offset : 14.8598us unmaskedWrite r/w-item with full mask : 13.7226us unmaskedWrite r/w-item with full mask and offset : 14.3353us setBit r/w-item with 1bit mask : 24.3967us setBit r/w-item with 1bit mask and offset : 24.9829us resetBit r/w-item with 1bit mask : 24.3639us resetBit r/w-item with 1bit mask and offset : 24.9634us setBit w-item with 1bit mask : 14.0308us setBit w-item with 1bit mask and offset : 14.5417us resetBit w-item with 1bit mask : 13.821us resetBit w-item with 1bit mask and offset : 14.4us ===============================================================================
Read and write performance as a function of the block size.
Distribution of read throughput for fixed block sizes (100 Measurements).
Distribution of write throughput for fixed block sizes (100 Measurements).
The HAL uses single word and block transfer accesses of the SBS module and uses the user-level linux library which comes with the module. Interrupt support is currently being implemented. It uses the SBS library support for interrupt handling (via callbacks to a user routine).
CMS wants to build/use VME64x modules which allow for plug and play crate configuration. With the SBS module it is possible configure a VME64x crate with VME64x modules which implement the VME64x-plug-and-play specification. (This means: it is possible to generate accesses with AM=2F.) The software is included in the HAL library. It has been tested with the first two VME64x VME modules of ECAL.
You should know that the SBS modules do not support D64, A64 or A40 accesses. You cannot expect terrific performance with it (see the measurements: 25-27 Mb/sec with a RAMix memory; SBS claims to have achieve 35Mb/sec (???!!!)). Another disadvantage might be, that you cannot chain the modules. If you want to have some minimal performance in the local data aquisition you may be do not want to do this anyway. (You can plug in principle many adapters in the same PC.
Be aware that you need an old conventional PCI 32 bit slot with 5V in order to be able to plug the module in the PC (there exists now modern servers which only have 3.3V PCI-64 bit connectors). The latest versions of the bridge (Model 620-3) also support 3.3V PCI slots. This is important for you if you also want to operate for example a Fedkit in the same PC: the GIII needs a 64 bit slot with 3.3V. But there are many motherboards which have a mixture of different slots.
With the current driver of SBS (v2p3p0) there is an issue if you want to use the user level interrupt callback mechanism in order to do plug and play according to the VME64 (NOT VME64x) specification. The specification requires that after power up you handle the interrupts of all boards one after the other: You must not acknowledge an interrupt of a board before having set the relevant registers for the module configuration. Unfortunately the SBS driver works in an incompatible for this procedure: The interrupts are all acknowledged and the calls of the user level interrupt handling routine are queued. When the handler is called the first time, the interrupts of all modules are already acknowledged.
The SBS bridge is in many repects better suited for CMS than
the National MXI bridge. The latter are made for use with VXI which we
do not use in CMS.
In addition the NI/MXI module has the following disadvantages:
The software is only partly public,
nobody ever succeeded to generate a large block transfer, software
updates seem to cost a lot of money, the LVDS cables are extremly
unhandy, it seems to be impossible to generate the 0x2f address modifier,
people have reported difficulties to use it in XDAQ-applications.
This Section deals only with the drivers for SLC4 kernels (2.6.x). Many issues of the driver of the 2.4.x kernel might still be existent. The driver has not been tested. It is only given here for people who have SBS modules in the labs and would like to try to continue to use them. Please also refer to the old documentation and the described problems therein.
SBS has been bought by another company and since then the source code of the
driver is only distributed with a non disclosure agreement. Therefore only
binary RPMs can be distributed here.
The binaries are available for kernel 2.6.9-55.0.6.EL.cernsmp here:
btp-2.6.9-55.EL.cernsmp-3.1.C.i586.rpm
btp-devel-2.6.9-55.EL.cernsmp-3.1.C.i586.rpm
btp-debuginfo-2.6.9-55.EL.cernsmp-3.1.C.i586.rpm
daq-sbslinuxbusadapter-4.0.2-4.i386.rpm
daq-sbslinuxbusadapter-devel-4.0.2-4.i386.rpm
SBS has officially released a driver version v2p3p0 which has been desinged for linux kernels 2.4.x. (Can be obtained from http://www.sbs.com).
This driver compiles and installs without problems on a CERN-Linux-Redhat-7.3.4 machine which has the kernel sources installed. (A small bug in the mkbtp script has been removed for the CMS version below). It also compiles and installs on CERN Linux SLC302 and SLC303 machines. HOWEVERthere is an issue for SLC303 machines (kernel 2.4.21-20.EL.cern and the corresponding smp version). On these kernels BusErrors get losts (the software continues as if the access with the BusError was successfull. In case of a read access arbitrary data is delivered to the user.) The reason for this behaviour and a work around has been found by Evgueni Vlassov:
A feature of the original SBS driver was that certain functions (those of the so called nano bus API) where not correctly declared as extern "C" if compiled with C++. This excluded the use of these functions in the HAL since the linker did not find the functions due to incorrect name mangling. As a consequence it was not possible to use the bt_reset() function in order to reset the VME bus. This has been corrected in the latest CMS-version fo the driver.
This version is based on the SBS version v2p3p0. It compiles without problems on CERN Linux 7.3.4. The btpapi.h had to be modified so that the bt_reset() function can be called from C++ programs. It works with HAL versions ver-03-04 and higher. Earlier versions have to adjust the path to the SBS driver by hand (in Makefile.in) since the v2p3p0 subdirectory is not recognized by those versions in the configure script.
gtar -xzvf SBS_{version}.tgz
cd SBS
./installSBS
/usr/local/SBS/1003/v2.0/sys/mkbtp
=============================================================================== ATTENTION ==> the measured time values do not measure the process time but the total time elapsed during the measurement (laboratory-time) So, in order to get meaningfull measurements, be sure not to have other active processes on your machine. =============================================================================== (TimeoutException) Timeout during polling the item "rwFlagMask" 1000ms have passed wheras the timeout has been set to 1000ms 3680000 polls have been carried out (HardwareDevice::pollItem) read r/w-item with full mask : 2.57833us read r/w-item with full mask and offset : 2.95839us write r/w-item with full mask : 2.99179us write r/w-item with full mask and offset : 3.42508us read r-item with full mask : 2.53569us read r-item with full mask and offset : 2.91862us write w-item with full mask : 2.66218us write w-item with full mask and offset: 3.07601us unmaskedRead r/w-item with full mask : 2.66056us unmaskedRead r/w-item with full mask and offset : 2.90977us unmaskedWrite r/w-item with full mask : 2.65765us unmaskedWrite r/w-item with full mask and offset : 2.92356us setBit r/w-item with 1bit mask : 3.26963us setBit r/w-item with 1bit mask and offset : 3.71627us resetBit r/w-item with 1bit mask : 3.26833us resetBit r/w-item with 1bit mask and offset : 3.69591us setBit w-item with 1bit mask : 2.95803us setBit w-item with 1bit mask and offset : 3.35657us resetBit w-item with 1bit mask : 2.85544us resetBit w-item with 1bit mask and offset : 3.37863us ===============================================================================
=============================================================================== ATTENTION ==> the measured time values do not measure the process time but the total time elapsed during the measurement (laboratory-time) So, in order to get meaningfull measurements, be sure not to have other active processes on your machine. =============================================================================== read r/w-item with full mask : 18.6139us read r/w-item with full mask and offset : 19.0851us write r/w-item with full mask : 33.4937us write r/w-item with full mask and offset : 34.2225us read r-item with full mask : 18.7048us read r-item with full mask and offset : 19.2273us write w-item with full mask : 18.5893us write w-item with full mask and offset: 18.9426us unmaskedRead r/w-item with full mask : 19.1327us unmaskedRead r/w-item with full mask and offset : 19.5662us unmaskedWrite r/w-item with full mask : 18.4104us unmaskedWrite r/w-item with full mask and offset : 19.0731us setBit r/w-item with 1bit mask : 34.2165us setBit r/w-item with 1bit mask and offset : 34.5748us resetBit r/w-item with 1bit mask : 33.7547us resetBit r/w-item with 1bit mask and offset : 34.6076us setBit w-item with 1bit mask : 18.9606us setBit w-item with 1bit mask and offset : 19.556us resetBit w-item with 1bit mask : 18.6855us resetBit w-item with 1bit mask and offset : 19.2885us ===============================================================================
Read and write performance as a function of the block size.
Distribution of read throughput for fixed block sizes (100 Measurements).
Distribution of write throughput for fixed block sizes (100 Measurements).