CROC : Tutorial
Pending Issues:
    ---

The LHCb note describing the CROC may be found at CROC note (preliminary)

CROC/CAT Version Compatibility

Date
CAT
lbCROC
CROC Fe PGA
CROC Spy PGA
31/01/08
v3r0
v1.7
E90A - v4 (11/12/07)
255D - v5 (12/12/07)

Latest version of the lbCROC package

CROC installed in the FSM

The CROC you want to use has been installed by an expert. You simply want to use it. If not go to the next section Creation and Installation of a CROC in the FSM.

Getting access to a CROC already installed in the FSM

You should first have a DNS server running and connect a SpecsServer to it.

Using the FSM Device Editor


Open the PVSS project and start the Device Editor. You should be in the Navigator mode (see example on the left).
Open the right tab called FSM. You will see the name of your project after the sys icon (in the example, HCDAQC1).
Clicking on the + symbol, you should open the hierarchy of devices included into the FSM structure of your project. The example contains a HCAL_DAQ control units that includes four others.
The CROC may appear as a single board, but usually it should be a board located into a crate. This is the case in our example as the CROC we try to edit is the central board of the crate 22 of the hadronic calorimeter. The crates belong to the HCAL_DAQ structure of the FSM tree. If you open it, you will see the HCAL crates driven by the project, HCAL 22 and HCAL 23, the two crates connected to the pc hcdaqhvc01w.
hcdaqhvc01w is the pc that drives the two HCAL crates of the side C of LHCb.

From a desktop shortcut

That's the easy way. You should have a shortcut linked to the Calorimeter FSM hierarchy. You may navigate down to your crate and the CROC you wish to look at.

Standard Configuration (Recipe)

Right click on the crate you want to have a look at (here HC22 for crate HCAL 22) from the FSM tree, and select the view option. This should open a window similar to the one below except from the fact that the CROC is probably in NOT_READY mode. You may either press the NOT_READY button of the full crate or specifically of the CROC and select Configure. Notice that configuring the crate will trigger a reset of the crate while the CROC configuration will not. After you ask for a configuration, the default settings (called PHYSICS) should be proposed and you should accept this default.
This last action will load the PHYSICS recipe and apply it to the CROC.
After a delay, the NOT_READY button (yellow) should turn into a blue READY one. You may now select START. This has no real effect on the CROC as it is ready to accept new L0 when it gets to the READY mode. The RUNNING state is used in order to reset counters or start some monitoring.

Configuring a CROC manually

CROC Panel
The standard settings are maybe NOT those of the screen capture above.
The CROC panel is divided in several subparts described below.

Warnings

Not implemented yet. The idea is that if something is wrong a red button will appear to indicate that a power cycle occured on a board, the temperature is in a strange range or the boards are not properly synchronized and the header detection performed by the CROC showed that the boards do not download the events synchronously.

Slot power

If a short circuit occured on a board a delatcher circuit temporarily switched off part of the corresponding board. This was detected by the CROC which kept track of the problem even if the board is powered back. Its configuration is now probably wrong and it is not synchronized with respect to the other FEB. A red light should appear above the board which had the problem.
The update button permits to refresh the corresponding information.
The Control line permits to manually stop powering a board. This control will act on the delatcher circuit and switch off the power on most of the components of the board. Pressing the control button above a board will switch between the ON and OFF states. Then you should apply the new configuration. This has to be used with cautions : the board will certainly not recover from such a power cycle without a full reconfiguration !
The ALL ON an ALL OFF button allow to easily power on/off the full crate. Pressing CLEAR will give you a chance not to do anything !

Crate ID and Temperature

The crate ID should not be changed as this value is sent by the CROC in the DAQ data words. This is looked at by the event builder which will probably not be happy to see another crate talking to the TELL1 connected to it. The value should be the crate number.
You certainly imagine that if you got to that point in the tutorial, you should understand what the temperature is... Have a look at the value. The temperature is not yet calibrated : 1920 is typically what you may expect.

Resets

There exist several resets for the CROC. You may choose to entirely reset the crate or the CROC only. Notice that the first includes the second. In both cases, the SPECS mezzanine of the CROC will switch from the CROC clock to its own internal clock. Working in such (asynchronous) conditions is hazardeous and you should redirect the CROC clock to the SPECS mezzanine after such an operation. This operation is done automatically but if not you may force it with the Clk Redir button.
The meaning of the other reset is understandable from the name of the button.

Slot Configuration

The slot configuration is divided into two main parts. The graphical view shows what the CROC knows about the actual configuration of the crate. The update button at the top of the panel permits to refresh the graphical view.
The series of buttons called Sel. FEB allows to mask a FEB which is not present or that should be masked (if it is not functioning satisfactorily). The Clear/Fill button unselect/select all the board. Its is required to acknowledge the operation with apply.

General Control

The General Controls configure the clock, channel B and L0 trigger. The CROC may produce those signals independently from the LHC TFC system. Except when debugging, those settings should be LHC.

Clock Settings

The clock setting define the configuration of the TTCrq mezzanine of the CROC. The fine delay tune the phase of the clock for the crate considered by steps of roughly 100ps. The coarse delay allows to adjust the time offset (25ns steps) of the channel B commands and of the L0 trigger

FE Synchronisation

The phase of the clock provided by the CROC to the FEB may be adjusted. This is the top setting. The CROC samples the data sent back by the boards. The phase for this sampling is choosen by the bottom spin control.

DAQ Synchronisation

Every L0 sent through the DAQ is made of 34 consecutive data words and two empty words. This sequence may be followed by another L0 or if no event is sent by empty words. The CROC uses the empty words between L0s or at the end of a L0) to synchronise the optic fibres. The synchronisation and the data sending operations have to be tuned with respect to the clock used to sample the data at the level of the GOL chips of the optical mezzanines. This is done by a using the direct clock or the inverted clock to sample the four front-end pgas data and the synchronisation signal of the spy pga. Hence, there are five tuning 4 for the FePGA and one for the SpyPGA.

Optical Mezzanine Mode

The GOL chips of the optical mezzanines may be configured either to send the front-end data (Physics mode) or not to take into account the data words and send through the optical fibres a predefined pattern (Test mode). The main purpose of this latter setting is to perform bit error rates on the optical connections. The RED light identify the test mode. The GREEN mode is the default. The mode may be selected for each GOL chip.

Creating a Recipe from a Script

The code below is the default Recipe Type register list for configuring a CROC.
Recipe Type
Most of the recipes should be based on this type. The following example shows the code to create a recipe to configure the CROC.

Creation and Installation of a CROC in the FSM

You are an expert and you want to install a CROC and maybe prepare a calorimeter crate in your PVSS project.

The CROC does not exist

You really start from scratch with a new project. The CROC type is not even known from PVSS. You should create both the CROC type but also the types of the subcomponents of the CROC (Delay Chip, TTCrq, SpecSMezzanine, Fe-PGA, Spy-PGA, etc...). This is done by clicking the create type button of the CROC creation panel (top left). A CROC may be configured by an expert, but it is usually put into a predefined state. The states are the recipes. Each recipe is of a certain type. A recipe type is a list of registers that a specific recipe may deal with. When you define the CROC type, you may wish to create the predefined recipe types. The recipes are attached to a specific board and will be created altogether with the actual CROC board creations.

The CROC type already exists

The CROC and its recipe types exist. On the CROC creation panel, you should give the name if the CROC you wish to build.

Installing a single CROC board

Installing a ECAL/HCAL Crate