/************************************************************************************ * the histogram control structure: Set of basic variables that control histograms. * * Fields: * * dpsf update. * * nModules: Depends upon the histogram set; indicates the number of modules * to histogram. * * histogramsAreSetup: Flag indicating whether or not the histoSetup routine * has been run; if not, the histogramming routines will * not execute. * * nBins: Defines the number of bins in each histogram. * * currentBin: The bin to be updated. * * base, size: The base address of histograms in memory, and their size. * * deltaChan, deltaChip, deltaModule: Control offsets from the base into the * histograms; calculated for 16 bit pointer * arithmetic. * * * ---------------------------------------------------------------------------------- * histograms in memory: * * ************************************************************************************/ #ifndef HISTOGRAM_STRUCT #define HISTOGRAM_STRUCT #include "serialStreams.h" #include "scanControl.h" #include "eventHandler.h" #define HISTOGRAM_BIN_MAX (0x100) #define N_STRIPS N_SCT_CHANS #define N_CHIPOCC_BINS 32 typedef struct BinCtr { UINT32 ctr[HISTOGRAM_BIN_MAX]; } BinCtr; /* Fields marked with a ** comment are needed by the assembly language routine, which has easy no way of getting the order of the structure members from the c structure. Therefore if changes are made which alter these fields positions with respect to the start of the structure or each other, the assembly code's offsets will need updating. */ typedef struct HistoCtrl { UINT8 histogramsAreSetup, histogramSet, verbose, doChipOcc, unused0, dataFormat, routineType, dataWarn, registerFlag, nValidModules, calLine, calLineEnable; UINT32 asmGuard; UINT32 stageFirst, emptyLength /**/; UINT32 hashScheme/**/, hash, nStages; UINT32 eventsPerL1A, binSize/**/, dataType[2]; UINT8 doOccupancy/**/, doTimeSlice/**/, doTotSpect/**/, doTotMean/**/; UINT32 deltaChan, deltaColumn/**/, deltaChp/**/, deltaHash/**/; /* all ** hashing */ UINT32 deltaChip, deltaModule, deltaBin, deltaTS/**/, deltaSlice, deltaSet; UINT32 *lutBase /**/; UINT16 nBins, currentBin; UINT32 repetitions; MDAT32 *xPtr[2]; UINT32 *base, *invalidData/**/, size, *occBase, unused1[4]; UINT32 moduleRangeMap[2][2]; UINT32 validModules[2]; BinCtr *binCtr; UINT32 *fitBase, fitLength; void (*histoFxn)(struct EventData *); UINT32 asmGuard2; /* The moduleBase array gives a pointer to the base of histograms (per link); the 1st set ([0]) is initialized at histogram setup, and the 2nd set ([1]) is initialized at the start of each bin. Links are defined in the ROD-standard way: 0x00-0x0b => formatter 0, links 0-11, 0x70-0x7b => formatter 7, links 0-11. If anything other than 32-bit binning is used, the module base pointer initializations will be correct, but to be used they must be re-cast as a pointer to words. */ UINT32 *moduleBase[2][128]; UINT32 unused2[8]; } HistoCtrl; #if defined(I_AM_MASTER_DSP) #include "timing.h" typedef struct { UINT8 rangeList, serialPort, unused[2]; UINT32 validModules[2]; UINT32 *L1id; UINT32 *nEvents, *nErrors; } GroupInfo; typedef struct { UINT8 dspNum, nContribGroups, nPorts, ports; UINT8 groupId[N_MODULE_GROUPS]; UINT8 paired, pair, active, mask; UINT8 nModules, unused[3]; UINT32 L1id[2]; UINT32 validModules[2]; UINT32 trapCmd; UINT32 trapStat[3]; UINT8 iHead, xHead, iTail, xTail; UINT8 nIdram, nSdram; UINT16 nWait; UINT32 nTrig, nErrors, nEvents, nErrorsTot; UINT32 delErr; UINT32 updateCnt; UINT32 avgProcTime; UINT16 avgEvtLen; UINT16 sigmaEvtLen; UINT32 seriesEvents[2], seriesErrors[2]; //UINT32 avgProcTime; //UINT32 avgTimeToHeader, avgTransmitTime, avgTimeToTrailer; //UINT32 avgExtraProcTime, avgDwellTime; } DspInfo; typedef struct { ScanControl *scan; ScanStatus *status; ScanTimingInfo *timing; UINT8 slvBits, evtWait; UINT8 cfgSet, cfgReg[2]; UINT8 nBins[2], bin0, port; UINT32 dataType[2]; UINT8 groupRangeMap[2]; /* bitfield indicating which module groups use which range set. */ MDAT32 *dataPtr[2]; UINT32 repetitions, trigLoopMax, trigSent, efbCnt, trapSeries; UINT32 taskTimeMax; UINT32 deltaTrig, trigDelay; UINT8 groupSPMap[2]; UINT8 groupDSPMap[4]; UINT8 defGroups; UINT8 nDspPairs, dspPair[2][2]; GroupInfo groupInfo[N_MODULE_GROUPS]; UINT16 evtLen; DspInfo dspInfo[N_SDSP]; UINT8 manual, soft_bc_reset, autoStall; UINT8 trigPause, binPause, stagePause; Module *moduleCfg; UINT8 mod8[2]; UINT8 extSetup, dataPath; UINT32 slvRep, sdspAttention; UINT32 initTime, trigTime, time, interval; UINT32 *ptr, nSets; CmdBuff *cmdBuffer[2]; CmdList *cmdListPtr[2], postConfigCmdList, triggerSequence[2]; UINT8 SPTriggers[2], SPEcr[2], ecrSent, triggerPairs; UINT8 L1idReset, extrap; UINT8 calLineLoop, calLine; UINT8 first, ready, expecting, proc, pbin, done, reinit; UINT8 singleCfgVar[2]; UINT8 stageAdvance, chipAdvance, binAdvance[2], sendCfg[2]; UINT8 twoDScan, pulsing, eventReTransmits, goodEvent; UINT32 reTransmitCnt; UINT32 stageCfg; INT32 error; } MasterHistoCtrl; #endif /* MDSP */ #endif /* Multiple-inclusion protection. */