00001 /************************************************************************************ 00002 * Title: scanControl.h 00003 * Version: 4th September 2003 00004 * 00005 * Description: ROD Master DSP scan configuration structure 00006 * and constant definitions. See sctScanStructures.h, 00007 * ABCDscans.h & pixelScanStructures.h for scan parameter definitions 00008 * and detector-specific scan structures. 00009 ************************************************************************************/ 00010 #ifndef SCAN_CONTROL_H /* multiple inclusion protection */ 00011 #define SCAN_CONTROL_H 00012 #include "processor.h" 00013 #if defined(SCT_ROD) 00014 #include "ABCD/ABCDscans.h" 00015 #elif defined(PIXEL_ROD) 00016 #include "pixelScanStructures.h" 00017 #endif 00018 00019 #define N_CMD_LIST_CMDS 6 00020 struct CmdList { 00021 UINT16 cmd[N_CMD_LIST_CMDS]; 00022 UINT32 data[N_CMD_LIST_CMDS]; 00023 }; 00024 00025 /* Scan control structures. For SCT the dual parameters in ScanGeneral (scanParameter, 00026 scanStart, scanEnd, nBins, dataPtr) and ScanDspDistribution (groupRangeMap) are used 00027 to implement power & load balancing on the SDSPs: 4 groups of modules are scanned 00028 upward together (1/SDSP), while a second set of 4 groups is scanned downward. For 00029 Pixels, the dual parameters in ScanGeneral describe the inner and outer loops 00030 ([0] & [1] respectively) for a two dimensional scan. The groupRangeMap parameter 00031 is unused; all module groups use the same mapping. */ 00032 typedef struct { 00033 UINT8 configSet; /* The configuration set to use (INIT/WORK/SPARE) */ 00034 UINT8 reportErrors; /* Toggle to enable data integrity checks on SDSPs */ 00035 UINT8 globalCtrl; /* Determines whether MDSP or TIM sends triggers */ 00036 UINT8 moduleScanMode; /* Concurrent or FE by FE */ 00037 00038 UINT8 scanParameter[2]; /* Scan parameter specifier */ 00039 UINT8 uniformPoints[2]; /* If TRUE scanStart, scanEnd & nBins determine points */ 00040 00041 MDAT32 scanStart[2]; /* Start value for uniform scan */ 00042 MDAT32 scanEnd[2]; /* End value for uniform scan */ 00043 00044 #if defined(SCT_ROD) 00045 UINT16 nBins[2]; /* # of bins in inner & outer loop */ 00046 //UINT16 nBins, unused; /* # of bins */ 00047 #elif defined(PIXEL_ROD) 00048 UINT16 nBins[2]; /* # of bins in inner & outer loop */ 00049 #endif 00050 UINT32 repetitions; /* # of events per bin */ 00051 MDAT32 *dataPtr[2]; /* pointers to data for custom scans; 0xffffffff 00052 (DEFAULT) indicates that data is in the primitive list 00053 right after the scan structure. */ 00054 00055 UINT8 maskMode; /* Staged or static */ 00056 UINT8 stageAdvanceFirst; /* Indicates whether the innermost loop is the mask stage 00057 or bin[0] parameter */ 00058 UINT16 maskStages; /* Number of mask stages to actually execute in scan */ 00059 00060 #if defined(SCT_ROD) 00061 UINT8 stage0; /* Initial Mask stage. */ 00062 UINT8 unused1; 00063 #elif defined(PIXEL_ROD) 00064 UINT8 maskStageMode; /* Mask staging option i.e. which ctrl bits are staged */ 00065 UINT8 maskStagePattern; /* Mask stage pattern option e.g. 32-stage, 160-stage etc. */ 00066 #endif 00067 UINT16 unused2; 00068 00069 UINT8 unused3; 00070 UINT8 currentChip; /* Current chip being scanned if FE-by-FE mode */ 00071 UINT16 currentMaskStage; /* Current mask stage */ 00072 UINT16 currentBin[2]; /* Current scanning point */ 00073 UINT32 currentDelay; 00074 00075 } ScanGeneral; /* General scan parameters */ 00076 00077 typedef struct { 00078 UINT32 *base; /* Base of histograms in SDSP memory; 0xffffffff=> default */ 00079 UINT8 opt[4]; /* histogramming options: [0] TRUE => do occupancy histo. 00080 [1] TRUE => do time-slice spectrum 00081 [2] bit 0 set: do TOT spectrum, 00082 bit 3 set: do TOT mean calculation 00083 [3] will be filled in by MDSP (indicates 00084 #evt./L1A for SDSP). */ 00085 UINT8 extSetup; /* Indicates whether MDSP will set up the router & SDSPs or not */ 00086 UINT8 errors; /* Toggles histogramming of errors (error task) */ 00087 #if defined(SCT_ROD) 00088 UINT8 unused[2]; 00089 #elif defined(PIXEL_ROD) 00090 UINT8 errorsMCC; /* Toggles histogramming of MCC errors (error task) */ 00091 UINT8 unused; 00092 #endif 00093 00094 } ScanRODSetup; /* Histogramming options */ 00095 00096 00097 typedef struct { 00098 UINT8 definedGroups; /* bitfield indicating which groups are included in scan */ 00099 UINT8 nDspPairs; /* The # of SDSP pairs. A DSP pair use complementary SP 00100 and receive their trigger streams simultaneously; used 00101 for interference/ cross-rtalk checks. */ 00102 UINT8 slvBits; /* Indicates which SDSPs participate in scan. */ 00103 UINT8 unused0; 00104 00105 UINT8 dspPair[2][2]; /* The DSP pairs. */ 00106 #if defined(SCT_ROD) 00107 UINT8 groupRangeMap[2]; /* SCT: Bitfield indicating which mapping groups use. */ 00108 #elif defined(PIXEL_ROD) 00109 UINT8 unused[2]; 00110 #endif 00111 UINT8 groupSPMap[2]; /* Bitfield indicating which serial port groups use. */ 00112 UINT8 groupDSPMap[4]; /* Bitfields indicating to which SDSP groups send events.*/ 00113 00114 } ScanDspDistribution; /* Histogramming options */ 00115 00116 typedef struct { 00117 struct CmdList triggerSequence[2]; 00118 #if defined(SCT_ROD) 00119 UINT32 incData[2]; /* SCT: amount to increment command data by between bins. */ 00120 UINT8 incCmd[2]; /* SCT: index of command (typ. delay cmd) to increment */ 00121 UINT8 port; /* Serial ports to use: 0, 1 or both (2) */ 00122 UINT8 unused; 00123 #elif defined(PIXEL_ROD) 00124 UINT8 calcFromStruct; /* Pixel: indicates that the serial stream (cal. pulse/ 00125 delay/L1A) should be calculated from the scan control 00126 structure. */ 00127 UINT8 port; /* Serial ports to use: 0, 1 or both (2) */ 00128 UINT8 unused[2]; 00129 #endif 00130 } ScanSerialData; 00131 00132 00133 #if defined(SCT_ROD) 00134 typedef struct { 00135 ScanGeneral general; 00136 SCTScanReset reset; 00137 ScanRODSetup rodSetup; 00138 ScanDspDistribution dspDist; 00139 ScanSerialData serial; 00140 00141 } ScanControl; 00142 00143 #elif defined(PIXEL_ROD) 00144 typedef struct { 00145 ScanGeneral general; 00146 PixelScanStrobe strobe; 00147 PixelScanTrigger trigger; 00148 PixelScanReset reset; 00149 PixelScanFE fe; 00150 PixelScanMCC mcc; 00151 PixelScanFitting fitting; 00152 ScanRODSetup rodSetup; 00153 ScanDspDistribution dspDist; 00154 ScanSerialData serial; 00155 00156 } ScanControl; 00157 #endif 00158 00159 #endif /* Multiple inclusion protection */