Eric Documentation
Go to Newsom's Home Page
Hardware Section
Software Section
Revised last by CRN 21-Feb-96
This document was received from Eric as a document for running
the silicon software.
As you should all know, the data flow for silicon goes as follows:
SVX --> Driver Card --> FSDA --> FSCC --> Challenge computer
Each part of this chain has its own software needs.
The SVX chips are driven by the CAMAC-programmable sequencer called SRS.
There will probably be a single SRS module in the experiment, and all
silicon will run on on the same code. For commisioning purposes, other SRS
modules will be available. The code, or 'pattern', that will be run inside
the SRS is currently being discussed by Jim Russ, Prakash Mathew, Lev Uvarov
and myself. The design of this code affects the performance of the silicon
as well as the dead time of the experiment.
The Driver Card is the interface where SRS and calibration and control signals
are sent to the silicon detectors, and where information is obtained from
the SVX chips and sent on to the FSDA. It can be thought of as an extension
of the FSDA to where the detector sits. There are 4 channels on each
driver card. The only way to talk to the driver cards is through the FSDA.
Therefore the code that controls the DAC settings on the driver card is part
of the same code library that runs the FSDA. This library is discussed below.
The FSDA is a dual channel Fastbus module. It performs a rather sophisticated
set of manipulations on the SVX data as it comes from the silicon detectors
through the driver card. E781 is using the Fastbus Smart Crate Controller,
or FSCC, to talk to the FSDA's in a Fastbus crate. For commisioning purposes
and inter-spill calibration and monitoring, the FSDA will be read out with
standard Fastbus routines. They are called from the FSDA test library, which
is written in C, and resides on the FSCC. This library is described in the
next section.
The FSCC can access all the FSDA's in a Fastbus crate. It operates with
the VxWorks operating system, which allows only one user at a time. There
are 2 Fastbus crates in PC4 devoted to FSDA use, each with an FSCC assigned
to it. There is a Fastbus crate upstairs in PK72, which has been assigned
as a test stand for silicon hardware development.
-------------------------------------------------------------------
SRS code:
A simple routine to download SRS patterns exists in
/usr/products/silicon/srs
It is called load_srs and is a simple Fortran program with CAMAC calls.
Various patterns are in that directory and its subdirectories. No 'standard'
pattern exists yet.
FSDA performance code:
There are two sets of C code that can be downloaded into an FSCC to test
FSDA's and the silicon detectors connected to them. The first, written
by the ITEP group, from St. Petersburg, is located in
/usr/products/silicon/test/exe/svx.o
This code is menu driven and contains many basic routines to exercise the
registers of the FSDA's and readout silicon detectors. The main menu
looks like:
**********
FSDA: Main Menu Compiled: May 1 1995
Strike one of the listed keys to execute corresponding option:
0 Quit
1 Help
2 Change PA=17
3 Scan Crate
4 Simple Commands
5 Particular Tests
6 Event Emulation
7 Long-Term Run
8 Driver Card Test
Your choice?
**********
This code is fairly self-explanatory. All output is in the form of ascii
text files written to the fn781a Challenge machine.
Silicon detector test code:
Another set of code exist in the directory
/usr/products/silicon/monitor/exe/fsda_test_library.o
monitor.o
The monitor.o code was written by me to excercise the silicon detectors over
a long period of time. I decided that a standard set of routines was
needed to make code writing easier, so those general purpose routines are
in fsda_test_library.o. This code is downloaded into the appropriate FSCC
and started up from the VxWorks prompt. Output is to an ascii text file
and/or to a HistoScope file, both written onto a fn781a directory. (HBOOK
doesn't work on VxWorks operating systems.)
Here is a listing of the routines available:
Large scale programs (monitor.o)
---------------------
ped_hist - Histograms the pedestal averages and RMS for a detector.
ped_linearity - Makes a 2 dimensional histogram of pedestal averages and RMS
vs. calibration DAC setting.
ped_loop - Makes an average and RMS of pedestal values and checks periodically
to see whether any values have changed.
channel_count - Makes a 'waterfall' plot of channel occupancy vs calibration
DAC settting.
chip_count - Makes a 'waterfall' plot of chip occupancy vs calibration DAC
setting.
chip_loop - Makes a chip occupany plot and checks periodically to see whether
any values have changed significantly.
channel_sum - Makes a channel occupancy plot, weighted by the ADC value.
Smaller scale utility programs (monitor.o)
------------------------------
set_thresholds - Will prompt for calibration DAC settings for each chip on
a silicon detector board.
take_event - Takes a single event and prints out to the screen.
event_loop - Will take events in a loop until carriage return is pressed.
setup_fsda - Will setup an FSDA channel for appropriate readout.
test_sequence - Tests the output of a silicon detector to make sure the
addresses increment in sequence.
Lower level subroutines (fsda_test_library.o)
-----------------------
init_fb(void) - Initializes Fastbus parameters and grabs the Fastbus space.
final_fb(void) - Releases Fastbus space.
get_slot_ch(int *slot, int *ch, int *nchips) - Returns user input for slot
channel and number of chips of silicon detector.
get_single_threshold(int tbuffer[]); - Returns user input for a single
DAC setting.
get_all_thresholds(int tbuffer[]) - Returns user input for individual DAC
settings.
convert_threshold_order(int nch,array_of_int tempdir,
array_of_int temprev,int tbuffer[]) - Converts the DAC settings
from chip ordered to correct order for downloading.
configure_fsda(int slot) - Enables the FSDA in the given slot for readout.
reset_fsda(int slot) - Resets the FSDA.
clear_fsda(int slot) - Clears the buffers in the FSDA.
check_id(int slot) - Checks to see if there is an FSDA in the given slot.
enable_sparse(int slot) - Sets FSDA into 4-bit amplitude, sparse readout mode.
enable_lall(int slot) - Sets FSDA into 8-bit amplitude, latch all readout mode.
enable_channel(int slot, int ch) - Enables a single channel in the given FSDA.
disable_channel(int slot, int ch) - Disables a single channel in the given FSDA.
load_sequential_address(int slot,int ch,int nchips) - Loads the FSDA address
memory with a set of addresses that is sequential on each side.
load_alternating_address(int slot,int ch,int nchips) - Loads the FSDA address
memory with a set of addresses that alternates from side to
side.
load_plane_id(int slot,int ch, int dirid, int revid) - Loads the given I.D.
numbers into the FSDA memory.
load_zero_pedestals(int slot, int ch,int nchips) - Fills the FSDA pedestal
memory with zeros.
load_encoder(int slot, int ch) - Loads the FSDA 8 bit-->4 bit encoder.
load_shift_gain_register(int slot, int ch, int shift, int gain) - Loads the
FSDA shift-gain register.
check_fifo(int slot) - Checks to see whether an FSDA is empty.
wait_for_data(int slot) - Waits for data to appear in an FSDA. Can give a
timeout error.
run_dac_interface(int slot, int ch, int tbuffer[]) - Loads the DAC settings
into the driver card.
read_data(int slot, array_of_FB_word data_buffer, int *n_data_words) -
Reads out one event from the FSDA.
debug_print_out(int n_data_words,array_of_FB_word data_buffer) - Prints out
one event from the FSDA readout.
check_counters(int n_data_words,array_of_FB_word data_buffer) - Checks the
event counters in the data to see whether they are incrementing
properly.
Go to Newsom's Home Page