00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef HISTOGRAM_STRUCT
00032 #define HISTOGRAM_STRUCT
00033
00034 #include "serialStreams.h"
00035 #include "scanControl.h"
00036 #include "eventHandler.h"
00037
00038 #define HISTOGRAM_BIN_MAX (0x100)
00039 #define N_STRIPS N_SCT_CHANS
00040 #define N_CHIPOCC_BINS 32
00041
00042 typedef struct BinCtr {
00043 UINT32 ctr[HISTOGRAM_BIN_MAX];
00044 } BinCtr;
00045
00046
00047
00048
00049
00050
00051
00052 typedef struct HistoCtrl {
00053 UINT8 histogramsAreSetup, histogramSet, verbose, doChipOcc,
00054 unused0, dataFormat, routineType, dataWarn,
00055 registerFlag, nValidModules, calLine, calLineEnable;
00056
00057 UINT32 asmGuard;
00058
00059 UINT32 stageFirst, emptyLength ;
00060 UINT32 hashScheme, hash, nStages;
00061
00062 UINT32 eventsPerL1A, binSize, dataType[2];
00063 UINT8 doOccupancy, doTimeSlice, doTotSpect, doTotMean;
00064
00065 UINT32 deltaChan, deltaColumn, deltaChp, deltaHash;
00066 UINT32 deltaChip, deltaModule, deltaBin, deltaTS, deltaSlice, deltaSet;
00067
00068 UINT32 *lutBase ;
00069
00070 UINT16 nBins, currentBin;
00071 UINT32 repetitions;
00072 MDAT32 *xPtr[2];
00073
00074 UINT32 *base, *invalidData, size, *occBase,
00075 unused1[4];
00076
00077 UINT32 moduleRangeMap[2][2];
00078 UINT32 validModules[2];
00079 BinCtr *binCtr;
00080
00081 UINT32 *fitBase, fitLength;
00082 void (*histoFxn)(struct EventData *);
00083 UINT32 asmGuard2;
00084
00085
00086
00087
00088
00089
00090
00091 UINT32 *moduleBase[2][128];
00092
00093 UINT32 unused2[8];
00094
00095 } HistoCtrl;
00096
00097
00098 #if defined(I_AM_MASTER_DSP)
00099 #include "timing.h"
00100
00101 typedef struct {
00102 UINT8 rangeList, serialPort, unused[2];
00103 UINT32 validModules[2];
00104 UINT32 *L1id;
00105 UINT32 *nEvents, *nErrors;
00106 } GroupInfo;
00107
00108 typedef struct {
00109 UINT8 dspNum, nContribGroups, nPorts, ports;
00110 UINT8 groupId[N_MODULE_GROUPS];
00111 UINT8 paired, pair, active, mask;
00112
00113 UINT8 nModules, unused[3];
00114 UINT32 L1id[2];
00115 UINT32 validModules[2];
00116
00117 UINT32 trapCmd;
00118 UINT32 trapStat[3];
00119 UINT8 iHead, xHead, iTail, xTail;
00120 UINT8 nIdram, nSdram;
00121 UINT16 nWait;
00122
00123 UINT32 nTrig, nErrors, nEvents, nErrorsTot;
00124 UINT32 delErr;
00125
00126 UINT32 updateCnt;
00127 UINT32 avgProcTime;
00128 UINT16 avgEvtLen;
00129 UINT16 sigmaEvtLen;
00130
00131 UINT32 seriesEvents[2], seriesErrors[2];
00132
00133
00134
00135
00136 } DspInfo;
00137
00138
00139 typedef struct {
00140 ScanControl *scan;
00141 ScanStatus *status;
00142 ScanTimingInfo *timing;
00143
00144 UINT8 slvBits, evtWait;
00145 UINT8 cfgSet, cfgReg[2];
00146 UINT8 nBins[2], bin0, port;
00147
00148 UINT32 dataType[2];
00149
00150 UINT8 groupRangeMap[2];
00151
00152 MDAT32 *dataPtr[2];
00153
00154 UINT32 repetitions, trigLoopMax, trigSent, efbCnt, incCnt, trapSeries;
00155 UINT32 taskTimeMax;
00156 UINT32 deltaTrig, trigDelay;
00157 UINT32 tvTime[N_SDSP], tvDelay[N_SDSP];
00158
00159 UINT8 groupSPMap[2];
00160 UINT8 groupDSPMap[4];
00161
00162 UINT8 defGroups;
00163 UINT8 nDspPairs, dspPair[2][2];
00164
00165 GroupInfo groupInfo[N_MODULE_GROUPS];
00166 UINT16 evtLen;
00167 DspInfo dspInfo[N_SDSP];
00168
00169 UINT8 manual, soft_bc_reset, autoStall;
00170 UINT8 trigPause, binPause, stagePause;
00171
00172 Module *moduleCfg;
00173
00174 UINT8 mod8[2];
00175
00176 UINT8 extSetup, dataPath;
00177 UINT32 slvRep, sdspAttention;
00178
00179 UINT32 initTime, trigTime, time, interval;
00180 UINT32 *ptr, nSets;
00181 CmdBuff *cmdBuffer[2];
00182 CmdList *cmdListPtr[2], postConfigCmdList, triggerSequence[2];
00183 UINT8 SPTriggers[2], SPEcr[2], ecrSent, triggerPairs;
00184 UINT8 L1idReset, extrap;
00185 UINT8 calLineLoop, calLine;
00186
00187 UINT8 first, ready, expecting, proc, pbin, done, reinit;
00188
00189 UINT8 singleCfgVar[2];
00190 UINT8 stageAdvance, chipAdvance, binAdvance[2], sendCfg[2];
00191 UINT8 twoDScan, pulsing, eventReTransmits, goodEvent;
00192 UINT32 reTransmitCnt;
00193 UINT32 stageCfg;
00194 INT32 error;
00195
00196 UINT8 errCnt[4];
00197
00198
00199 } MasterHistoCtrl;
00200
00201 #endif
00202 #endif