/************************************************************************************ * Title: scanControl_sct.h * Version: 20th October 2004 * * Description: ROD MDSP scan configuration structure and constant definitions. * See ABCDScans.h for scan parameter definitions. ************************************************************************************/ #ifndef SCAN_CONTROL_SCT #define SCAN_CONTROL_SCT #include "scanTiming_sct.h" /* External setup flags for ScanRodSetup: */ #define EXT_SETUP_NONE 0 #define EXT_SETUP_RCF 1 #define EXT_SETUP_ROUTER 2 #define EXT_SETUP_SET 4 #define EXT_SETUP_HISTO 8 #define EXT_SETUP_HTASK 16 /* Scan control structures. For SCT, the dual parameters in ScanGeneral describe either the inner and outer loops ([0] & [1] respectively) for a 2D scan, or the two separate range lists of a balanced 1D scan. For 2D scans, power load balancing is only possible by setting the mirrored-range-list flag (which flips list[0] to get list[1]). */ typedef struct { UINT8 cfgSet; /* The configuration set to use (PHYSICS/SCAN/SPARE) */ UINT8 globalCtrl; /* Determines whether MDSP or TIM sends triggers */ UINT8 chip; /* ALL_CHIPS or (for ex.) M0_CHIP */ UINT8 unused; UINT8 scanParameter[2]; /* Scan parameter specifier */ UINT8 uniformPoints[2]; /* If TRUE scanStart, scanEnd & nBins determine points */ MDAT32 scanStart[2]; /* Start value for uniform scan */ MDAT32 scanEnd[2]; /* End value for uniform scan */ UINT16 nBins[2]; /* # of bins in inner & outer loop */ UINT32 repetitions; /* # of events per bin */ MDAT32 *dataPtr[2]; /* pointers to data for custom scans; 0xffffffff (DEFAULT) indicates that data is in the primitive list right after the scan structure. */ UINT8 maskMode; /* Staged or static */ UINT8 stageAdvanceFirst; /* Indicates whether the innermost loop is the mask stage or bin[0] parameter */ UINT8 maskStages; /* Number of mask stages to actually execute in scan */ UINT8 stage0; /* Initial Mask stage. */ } ScanGeneral; /* General scan parameters */ typedef struct { UINT32 *base; /* Base of histograms in SDSP memory; 0xffffffff=> default */ UINT8 binSize; /* Occupancy histogram bin size; other sizes are based on this. */ UINT8 routineType; /* Indicates the routine type (c or assembly language). */ UINT8 unused[2]; UINT8 opt[4]; /* options: [0] TRUE => do chip occupancy histo. [1] The link data format (condensed or expanded). [2] Verbose mode flag (c code only). [3] unused */ UINT8 errors; /* Toggles histogramming of errors (error task) */ UINT8 extSetup; /* Indicates whether MDSP will set up the router & SDSPs or not */ UINT8 dataPath; /* If the path == NORMAL, indicates data is expected from real modules. If the path == INMEM, simulated data will be built and used. See appendix C fo rmore details. */ UINT8 unused1; } ScanRodSetup; /* Histogramming options */ typedef struct { UINT8 definedGroups; /* bitfield indicating which groups are included in scan */ UINT8 nDspPairs; /* The # of SDSP pairs. A DSP pair use complementary SP and receive their trigger streams simultaneously; used for interference/ cross-rtalk checks. */ UINT8 slvBits; /* Indicates which SDSPs participate in scan. */ UINT8 mirroredRanges; /* If set, range map[1] will be a mirror image of map[0] (given by the bin[0] range); for 2-dimensional histograms this is the only way to have dual ranges. If not set, then for 1-D histograms, if nBins[1] == nBins[0] & both are read in as lists (not calculated), the lists give the customized rangeMaps. */ UINT8 dspPair[2][2]; /* The DSP pairs. */ UINT8 groupRangeMap[2]; /* Bitfield indicating which variable mapping groups use. */ UINT8 groupSPMap[2]; /* Bitfield indicating which serial port groups use. */ UINT8 groupDSPMap[4]; /* Bitfields indicating to which SDSP groups send events.*/ } ScanDspDistribution; /* Histogramming options */ typedef struct { struct CmdList triggerSequence[2]; UINT8 calcFromStruct; /* Pixel: indicates that the serial stream (cal. pulse/ delay/L1A) should be calculated from the scan control structure. */ UINT8 calL1ADelay; /* sets the delay (in BCO units) in the serial stream between the calibration command and the L1A */ UINT8 port; /* Serial ports to use: 0, 1 or both (2) */ UINT8 unused; } ScanSerialData; typedef struct { /* options for resetting modules (beginning of scan & between bins) */ UINT8 moduleInit; UINT8 binReset; UINT8 triggerReset; UINT8 unused; UINT8 ECR; UINT8 BCR; UINT8 unused1[2]; } SctScanReset; /* Scan reset options */ typedef struct { /* register parameters which need setting: */ UINT8 useScanSettings; /* If set, the modules in the input cfg. set will be configured using these settings. */ UINT8 trimRange; UINT8 readoutMode; UINT8 accumulate; UINT8 edgeDetect; UINT8 digitalInject; UINT8 unused[2]; } SctScanFE; /* FE specific options during scans */ typedef struct { UINT8 sCurves; /* Fit s-curves to the occupancy histos */ UINT8 calibrationOption; /* Standard time, standard charge or custom */ UINT8 unused[2]; FLOAT32 chi2Cut; FLOAT32 customScale; FLOAT32 customOffset; } SctScanFitting; /* Fitting options */ typedef struct { UINT32 currentBin[2]; /* Current scanning point(s) */ UINT32 currentMaskStage; /* Current mask stage */ UINT32 currentDelay; ScanTimingInfo timing; } ScanStatus; typedef struct { ScanGeneral general; SctScanReset reset; SctScanFE fe; SctScanFitting fitting; ScanRodSetup rodSetup; ScanDspDistribution dspDist; ScanSerialData serial; } ScanControl; #endif //Multiple inclusion protection.