next up previous contents
Next: 2 Routines for the Up: 1 Silicon Hit Finding Previous: 1.6 Compiling and loading

1.7 Main User Routine

  The call from the main ppcdaq_readout procedure is the following:

SiPPCUser ( long SiMode, long Raw_Address, long PPC PPCunit, long PIC,
long Hit_Address, long *Nbytes_Hit, long *Ierror)

Arguments are:
long SiMode: Readout mode (s. Section 1.4.1)
long Raw_Address: address of raw data buffer for this event
long PPCunit: no. of PowerPC board
long PIC: Pipeline Counter
long Hit_Address: address of hit data buffer to write to
long *Nbytes_Hit: length of data in hit buffer
long *Ierror: error code

The routine then checks (and eventually modifies) the PowerPC's hardware implementation dependent register 0 (HID0). The following bits are relevant:

See [Sha95] or [Mot96b] for information about the PowerPC 604 architecture.

After having done some checks on the input arguments, the routine then decides whether the PPC processes CST or BST data by checking the PPCunit number and then evaluates all the necessary information to be able to process the data of each of the 8 connected FADCs sequentially.

This is done by filling a C structure (FADCRec) for each of the FADCs containing:

The subbranch specific routines are then always called from within loops over 8 FADCs and have the connected FADCRec as argument. Thus, the actual routines do not have to care about memory organization.

SiPPCUser also caters for initialization procedures at run start, i.e. before the first event is being processed.

After the "setup" follows a SiMode switch. The routines for Hits&Cluster or Monitor mode are called for either CST or BST, for 8 FADCs sequentially. In case of Raw data mode, SiPPCUser simply returns. It should have never been called...

Since the VMEtaxi collects data from the Hit buffers of all PPC boards it is vital to increment the Nbytes_Hit return argument correctly. It is therefore passed as an argument to all subroutines writing to the Hit buffer.

A global variable *HitPtr points to the Hit buffer. It is again the responsibility of the subroutines to increment this pointer, otherwise data will simply be overwritten.


next up previous contents
Next: 2 Routines for the Up: 1 Silicon Hit Finding Previous: 1.6 Compiling and loading

Markus Kausch
Fri Oct 17 13:45:07 MST 1997