00001 /************************************************************************************ 00002 * Title: scanControl_sct.h 00003 * Version: 20th October 2004 00004 * 00005 * Description: ROD MDSP scan configuration structure and constant definitions. 00006 * See ABCDScans.h for scan parameter definitions. 00007 ************************************************************************************/ 00008 #ifndef SCAN_CONTROL_SCT 00009 #define SCAN_CONTROL_SCT 00010 #include "scanTiming_sct.h" 00011 00012 /* External setup flags for ScanRodSetup: */ 00013 #define EXT_SETUP_NONE 0 00014 #define EXT_SETUP_RCF 1 00015 #define EXT_SETUP_ROUTER 2 00016 #define EXT_SETUP_SET 4 00017 #define EXT_SETUP_HISTO 8 00018 #define EXT_SETUP_HTASK 16 00019 00020 /* Scan control structures. For SCT, the dual parameters in ScanGeneral describe 00021 either the inner and outer loops ([0] & [1] respectively) for a 2D scan, or the two 00022 separate range lists of a balanced 1D scan. For 2D scans, power load balancing is 00023 only possible by setting the mirrored-range-list flag (which flips list[0] to get 00024 list[1]). */ 00025 00026 typedef struct { 00027 UINT8 cfgSet; /* The configuration set to use (PHYSICS/SCAN/SPARE) */ 00028 UINT8 globalCtrl; /* Determines whether MDSP or TIM sends triggers */ 00029 UINT8 chip; /* ALL_CHIPS or (for ex.) M0_CHIP */ 00030 UINT8 unused; 00031 00032 UINT8 scanParameter[2]; /* Scan parameter specifier */ 00033 UINT8 uniformPoints[2]; /* If TRUE scanStart, scanEnd & nBins determine points */ 00034 00035 MDAT32 scanStart[2]; /* Start value for uniform scan */ 00036 MDAT32 scanEnd[2]; /* End value for uniform scan */ 00037 00038 UINT16 nBins[2]; /* # of bins in inner & outer loop */ 00039 UINT32 repetitions; /* # of events per bin */ 00040 MDAT32 *dataPtr[2]; /* pointers to data for custom scans; 0xffffffff 00041 (DEFAULT) indicates that data is in the primitive list 00042 right after the scan structure. */ 00043 00044 UINT8 maskMode; /* Staged or static */ 00045 UINT8 stageAdvanceFirst; /* Indicates whether the innermost loop is the mask stage 00046 or bin[0] parameter */ 00047 UINT8 maskStages; /* Number of mask stages to actually execute in scan */ 00048 00049 UINT8 stage0; /* Initial Mask stage. */ 00050 } ScanGeneral; /* General scan parameters */ 00051 00052 typedef struct { 00053 UINT32 *base; /* Base of histograms in SDSP memory; 0xffffffff=> default */ 00054 UINT8 binSize; /* Occupancy histogram bin size; other sizes are based on this. */ 00055 UINT8 routineType; /* Indicates the routine type (c or assembly language). */ 00056 UINT8 unused[2]; 00057 UINT8 opt[4]; /* options: [0] TRUE => do chip occupancy histo. 00058 [1] The link data format (condensed or expanded). 00059 [2] Verbose mode flag (c code only). 00060 [3] unused */ 00061 00062 UINT8 errors; /* Toggles histogramming of errors (error task) */ 00063 UINT8 extSetup; /* Indicates whether MDSP will set up the router & SDSPs or not */ 00064 UINT8 dataPath; /* If the path == NORMAL, indicates data is expected from real 00065 modules. If the path == INMEM, simulated data will be built 00066 and used. See appendix C fo rmore details. */ 00067 UINT8 unused1; 00068 } ScanRodSetup; /* Histogramming options */ 00069 00070 00071 typedef struct { 00072 UINT8 definedGroups; /* bitfield indicating which groups are included in scan */ 00073 UINT8 nDspPairs; /* The # of SDSP pairs. A DSP pair use complementary SP 00074 and receive their trigger streams simultaneously; used 00075 for interference/ cross-rtalk checks. */ 00076 UINT8 slvBits; /* Indicates which SDSPs participate in scan. */ 00077 UINT8 mirroredRanges; /* If set, range map[1] will be a mirror image of map[0] 00078 (given by the bin[0] range); for 2-dimensional histograms 00079 this is the only way to have dual ranges. If not set, then for 1-D histograms, 00080 if nBins[1] == nBins[0] & both are read in as lists (not calculated), the lists 00081 give the customized rangeMaps. */ 00082 00083 UINT8 dspPair[2][2]; /* The DSP pairs. */ 00084 UINT8 groupRangeMap[2]; /* Bitfield indicating which variable mapping groups use. */ 00085 UINT8 groupSPMap[2]; /* Bitfield indicating which serial port groups use. */ 00086 UINT8 groupDSPMap[4]; /* Bitfields indicating to which SDSP groups send events.*/ 00087 00088 } ScanDspDistribution; /* Histogramming options */ 00089 00090 typedef struct { 00091 struct CmdList triggerSequence[2]; 00092 UINT8 calcFromStruct; /* Pixel: indicates that the serial stream (cal. pulse/ 00093 delay/L1A) should be calculated from the scan control 00094 structure. */ 00095 UINT8 calL1ADelay; /* sets the delay (in BCO units) in the serial stream 00096 between the calibration command and the L1A */ 00097 UINT8 port; /* Serial ports to use: 0, 1 or both (2) */ 00098 UINT8 unused; 00099 } ScanSerialData; 00100 00101 typedef struct { 00102 /* options for resetting modules (beginning of scan & between bins) */ 00103 UINT8 moduleInit; 00104 UINT8 binReset; 00105 UINT8 triggerReset; 00106 UINT8 unused; 00107 00108 UINT8 ECR; 00109 UINT8 BCR; 00110 UINT8 unused1[2]; 00111 } SctScanReset; /* Scan reset options */ 00112 00113 typedef struct { 00114 /* register parameters which need setting: */ 00115 UINT8 useScanSettings; /* If set, the modules in the input cfg. set will 00116 be configured using these settings. */ 00117 UINT8 trimRange; 00118 UINT8 readoutMode; 00119 UINT8 accumulate; 00120 00121 UINT8 edgeDetect; 00122 UINT8 digitalInject; 00123 UINT8 unused[2]; 00124 } SctScanFE; /* FE specific options during scans */ 00125 00126 typedef struct { 00127 UINT8 sCurves; /* Fit s-curves to the occupancy histos */ 00128 UINT8 calibrationOption; /* Standard time, standard charge or custom */ 00129 UINT8 unused[2]; 00130 00131 FLOAT32 chi2Cut; 00132 FLOAT32 customScale; 00133 FLOAT32 customOffset; 00134 } SctScanFitting; /* Fitting options */ 00135 00136 typedef struct { 00137 UINT32 currentBin[2]; /* Current scanning point(s) */ 00138 UINT32 currentMaskStage; /* Current mask stage */ 00139 UINT32 currentDelay; 00140 00141 ScanTimingInfo timing; 00142 } ScanStatus; 00143 00144 typedef struct { 00145 ScanGeneral general; 00146 SctScanReset reset; 00147 SctScanFE fe; 00148 SctScanFitting fitting; 00149 ScanRodSetup rodSetup; 00150 ScanDspDistribution dspDist; 00151 ScanSerialData serial; 00152 00153 } ScanControl; 00154 00155 #endif //Multiple inclusion protection.