NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
pixie16app_globals.h
1 #ifndef PIXIE16APP_GLOBALS_H
2 #define PIXIE16APP_GLOBALS_H
3 
4 /*----------------------------------------------------------------------
5  * Copyright (c) 2005 - 2009, XIA LLC
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms,
9  * with or without modification, are permitted provided
10  * that the following conditions are met:
11  *
12  * * Redistributions of source code must retain the above
13  * copyright notice, this list of conditions and the
14  * following disclaimer.
15  * * Redistributions in binary form must reproduce the
16  * above copyright notice, this list of conditions and the
17  * following disclaimer in the documentation and/or other
18  * materials provided with the distribution.
19  * * Neither the name of XIA LLC nor the names of its
20  * contributors may be used to endorse or promote
21  * products derived from this software without
22  * specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
25  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
26  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
27  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28  * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
29  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
33  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
34  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
35  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36  * SUCH DAMAGE.
37  *----------------------------------------------------------------------*/
38 
39 /******************************************************************************
40  *
41  * File Name:
42  *
43  * pixie16app_globals.h
44  *
45  * Description:
46  *
47  * Declaration of global variables and data arrays.
48  *
49  * $Rev: 29161 $
50  * $Id: pixie16app_globals.h 29161 2014-01-09 19:27:58Z htan $
51  ******************************************************************************/
52 
53 // If this is compiled by a C++ compiler, make it
54 // clear that these are C routines.
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 #ifndef __PIXIE16APP_DEFS_H
60  #include "pixie16app_defs.h"
61 #endif
62 
63 
64 unsigned short Number_Modules; // Total number of modules in the crate
65 unsigned short Random_Set[RANDOMINDICES_LENGTH]; // Random indices
66 unsigned short Offline; // Offline = 1: offline analysis; Offline = 0: online analysis
67 
68 
69 /*-----------------------------------------------------------------
70  Pixie global data structure
71  -----------------------------------------------------------------*/
72 
74 {
75 
76  // DSP I/O parameter values
77  unsigned int DSP_Parameter_Values[N_DSP_PAR];
78 
79 };
80 
81 // Define PRESET_MAX_MODULES Pixie devices
82 struct Pixie_Configuration Pixie_Devices[PRESET_MAX_MODULES];
83 
84 
86 {
87  // Module information
88  unsigned short Module_Rev;
89  unsigned int Module_SerNum;
90  unsigned short Module_ADCBits;
91  unsigned short Module_ADCMSPS;
92 };
93 
94 // Define PRESET_MAX_MODULES Pixie devices
95 struct Module_Info Module_Information[PRESET_MAX_MODULES];
96 
97 
98 /*-----------------------------------------------------------------
99  DSP I/O parameters address
100  We initialize these addressee when we boot the modules, then
101  we can use them when we need to change DSP parameters.
102  -----------------------------------------------------------------*/
103 
104 //--------------------
105 // Module parameters
106 //--------------------
107 
108 unsigned int ModNum_Address[PRESET_MAX_MODULES]; // ModNum
109 unsigned int ModCSRA_Address[PRESET_MAX_MODULES]; // ModCSRA
110 unsigned int ModCSRB_Address[PRESET_MAX_MODULES]; // ModCSRB
111 unsigned int ModFormat_Address[PRESET_MAX_MODULES]; // ModFormat
112 unsigned int RunTask_Address[PRESET_MAX_MODULES]; // RunTask
113 unsigned int ControlTask_Address[PRESET_MAX_MODULES]; // ControlTask
114 unsigned int MaxEvents_Address[PRESET_MAX_MODULES]; // MaxEvents
115 unsigned int CoincPattern_Address[PRESET_MAX_MODULES]; // CoincPattern
116 unsigned int CoincWait_Address[PRESET_MAX_MODULES]; // CoincWait
117 unsigned int SynchWait_Address[PRESET_MAX_MODULES]; // SynchWait
118 unsigned int InSynch_Address[PRESET_MAX_MODULES]; // InSynch
119 unsigned int Resume_Address[PRESET_MAX_MODULES]; // Resume
120 unsigned int SlowFilterRange_Address[PRESET_MAX_MODULES];// SlowFilterRange
121 unsigned int FastFilterRange_Address[PRESET_MAX_MODULES];// FastFilterRange
122 unsigned int ChanNum_Address[PRESET_MAX_MODULES]; // ChanNum
123 unsigned int HostIO_Address[PRESET_MAX_MODULES]; // HostIO
124 unsigned int UserIn_Address[PRESET_MAX_MODULES]; // UserIn
125 unsigned int U00_Address[PRESET_MAX_MODULES]; // U00
126 unsigned int FastTrigBackplaneEna_Address[PRESET_MAX_MODULES]; // Enabling sending fast trigger to backplane
127 unsigned int CrateID_Address [PRESET_MAX_MODULES]; // CrateID
128 unsigned int SlotID_Address [PRESET_MAX_MODULES]; // SlotID
129 unsigned int ModID_Address [PRESET_MAX_MODULES]; // ModID
130 unsigned int TrigConfig_Address [PRESET_MAX_MODULES]; // General configuration registers
131 unsigned int HRTP_Address[PRESET_MAX_MODULES]; // HostRunTimePreset
132 
133 //--------------------
134 // Channel parameters
135 //--------------------
136 
137 unsigned int ChanCSRa_Address[PRESET_MAX_MODULES]; // ChanCSRa
138 unsigned int ChanCSRb_Address[PRESET_MAX_MODULES]; // ChanCSRb
139 
140 unsigned int GainDAC_Address[PRESET_MAX_MODULES]; // GainDAC
141 
142 unsigned int OffsetDAC_Address[PRESET_MAX_MODULES]; // OffsetDAC
143 
144 unsigned int DigGain_Address[PRESET_MAX_MODULES]; // DigGain
145 
146 unsigned int SlowLength_Address[PRESET_MAX_MODULES]; // SlowLength
147 unsigned int SlowGap_Address[PRESET_MAX_MODULES]; // SlowGap
148 unsigned int FastLength_Address[PRESET_MAX_MODULES]; // FastLength
149 unsigned int FastGap_Address[PRESET_MAX_MODULES]; // FastGap
150 unsigned int PeakSample_Address[PRESET_MAX_MODULES]; // PeakSample
151 unsigned int PeakSep_Address[PRESET_MAX_MODULES]; // PeakSep
152 
153 unsigned int CFDThresh_Address[PRESET_MAX_MODULES]; // CFDThresh
154 
155 unsigned int FastThresh_Address[PRESET_MAX_MODULES]; // FastThresh
156 unsigned int ThreshWidth_Address[PRESET_MAX_MODULES]; // ThreshWidth
157 unsigned int PAFlength_Address[PRESET_MAX_MODULES]; // PAFlength
158 unsigned int TriggerDelay_Address[PRESET_MAX_MODULES]; // TriggerDelay
159 unsigned int ResetDelay_Address[PRESET_MAX_MODULES]; // ResetDelay
160 unsigned int ChanTrigStretch_Address[PRESET_MAX_MODULES];// ChanTrigStretch
161 unsigned int TraceLength_Address[PRESET_MAX_MODULES]; // TraceLength
162 unsigned int TrigOutLen_Address[PRESET_MAX_MODULES]; // TrigOutLen
163 unsigned int EnergyLow_Address[PRESET_MAX_MODULES]; // EnergyLow
164 unsigned int Log2Ebin_Address[PRESET_MAX_MODULES]; // Log2Ebin
165 
166 unsigned int MultiplicityMaskL_Address[PRESET_MAX_MODULES]; // Multiplicity contribution mask - low 32-bit
167 
168 unsigned int PSAoffset_Address[PRESET_MAX_MODULES]; // PSAoffset
169 unsigned int PSAlength_Address[PRESET_MAX_MODULES]; // PSAlength
170 unsigned int Integrator_Address[PRESET_MAX_MODULES]; // Integrator
171 
172 unsigned int BLcut_Address[PRESET_MAX_MODULES]; // BLcut
173 unsigned int BaselinePercent_Address[PRESET_MAX_MODULES];// BaselinePercent
174 
175 unsigned int FtrigoutDelay_Address[PRESET_MAX_MODULES]; // Fast trigger output delay for system synchronization
176 
177 unsigned int Log2Bweight_Address[PRESET_MAX_MODULES]; // Log2Bweight
178 unsigned int PreampTau_Address[PRESET_MAX_MODULES]; // PreampTau
179 
180 unsigned int MultiplicityMaskH_Address[PRESET_MAX_MODULES]; // Multiplicity contribution mask - high 32-bit
181 
182 unsigned int FastTrigBackLen_Address[PRESET_MAX_MODULES]; // FastTrigBackLen
183 
184 unsigned int CFDDelay_Address [PRESET_MAX_MODULES]; // CFD delay
185 unsigned int CFDScale_Address [PRESET_MAX_MODULES]; // CFD scale
186 unsigned int ExternDelayLen_Address[PRESET_MAX_MODULES]; // delay length for each channel's input signal
187 unsigned int ExtTrigStretch_Address[PRESET_MAX_MODULES]; // external trigger stretch
188 unsigned int VetoStretch_Address [PRESET_MAX_MODULES]; // veto stretch
189 unsigned int QDCLen0_Address [PRESET_MAX_MODULES]; // QDC #0 length
190 unsigned int QDCLen1_Address [PRESET_MAX_MODULES]; // QDC #1 length
191 unsigned int QDCLen2_Address [PRESET_MAX_MODULES]; // QDC #2 length
192 unsigned int QDCLen3_Address [PRESET_MAX_MODULES]; // QDC #3 length
193 unsigned int QDCLen4_Address [PRESET_MAX_MODULES]; // QDC #4 length
194 unsigned int QDCLen5_Address [PRESET_MAX_MODULES]; // QDC #5 length
195 unsigned int QDCLen6_Address [PRESET_MAX_MODULES]; // QDC #6 length
196 unsigned int QDCLen7_Address [PRESET_MAX_MODULES]; // QDC #7 length
197 
198 unsigned int Xwait_Address[PRESET_MAX_MODULES]; // Xwait
199 
200 
201 //--------------------
202 // Results parameters
203 //--------------------
204 
205 unsigned int RealTimeA_Address[PRESET_MAX_MODULES]; // RealTimeA
206 unsigned int RealTimeB_Address[PRESET_MAX_MODULES]; // RealTimeB
207 unsigned int RunTimeA_Address[PRESET_MAX_MODULES]; // RunTimeA
208 unsigned int RunTimeB_Address[PRESET_MAX_MODULES]; // RunTimeB
209 unsigned int GSLTtime_Address[PRESET_MAX_MODULES]; // GSLTtime
210 unsigned int NumEventsA_Address[PRESET_MAX_MODULES]; // NumEventsA
211 unsigned int NumEventsB_Address[PRESET_MAX_MODULES]; // NumEventsB
212 unsigned int DSPerror_Address[PRESET_MAX_MODULES]; // DSPerror
213 unsigned int SynchDone_Address[PRESET_MAX_MODULES]; // SynchDone
214 unsigned int BufHeadLen_Address[PRESET_MAX_MODULES]; // BufHeadLen
215 unsigned int EventHeadLen_Address[PRESET_MAX_MODULES]; // EventHeadLen
216 unsigned int ChanHeadLen_Address[PRESET_MAX_MODULES]; // ChanHeadLen
217 unsigned int UserOut_Address[PRESET_MAX_MODULES]; // UserOut
218 unsigned int AOutBuffer_Address[PRESET_MAX_MODULES]; // AOutBuffer
219 unsigned int LOutBuffer_Address[PRESET_MAX_MODULES]; // LOutBuffer
220 unsigned int AECorr_Address[PRESET_MAX_MODULES]; // AECorr
221 unsigned int LECorr_Address[PRESET_MAX_MODULES]; // LECorr
222 unsigned int HardwareID_Address[PRESET_MAX_MODULES]; // HardwareID
223 unsigned int HardVariant_Address[PRESET_MAX_MODULES]; // HardVariant
224 unsigned int FIFOLength_Address[PRESET_MAX_MODULES]; // FIFOLength
225 unsigned int FippiID_Address[PRESET_MAX_MODULES]; // FippiID
226 unsigned int FippiVariant_Address[PRESET_MAX_MODULES]; // FippiVariant
227 unsigned int DSPrelease_Address[PRESET_MAX_MODULES]; // DSPrelease
228 unsigned int DSPbuild_Address[PRESET_MAX_MODULES]; // DSPbuild
229 unsigned int DSPVariant_Address[PRESET_MAX_MODULES]; // DSPVariant
230 unsigned int U20_Address[PRESET_MAX_MODULES]; // U20
231 unsigned int LiveTimeA_Address[PRESET_MAX_MODULES]; // LiveTimeA
232 unsigned int LiveTimeB_Address[PRESET_MAX_MODULES]; // LiveTimeB
233 unsigned int FastPeaksA_Address[PRESET_MAX_MODULES]; // FastPeaksA
234 unsigned int FastPeaksB_Address[PRESET_MAX_MODULES]; // FastPeaksB
235 unsigned int OverflowA_Address[PRESET_MAX_MODULES]; // OverflowA
236 unsigned int OverflowB_Address[PRESET_MAX_MODULES]; // OverflowB
237 unsigned int InSpecA_Address[PRESET_MAX_MODULES]; // InSpecA
238 unsigned int InSpecB_Address[PRESET_MAX_MODULES]; // InSpecB
239 unsigned int UnderflowA_Address[PRESET_MAX_MODULES]; // UnderflowA
240 unsigned int UnderflowB_Address[PRESET_MAX_MODULES]; // UnderflowB
241 unsigned int ChanEventsA_Address[PRESET_MAX_MODULES]; // ChanEventsA
242 unsigned int ChanEventsB_Address[PRESET_MAX_MODULES]; // ChanEventsB
243 unsigned int AutoTau_Address[PRESET_MAX_MODULES]; // AutoTau
244 unsigned int U30_Address[PRESET_MAX_MODULES]; // U30
245 
246 
247 
248 #ifdef __cplusplus
249 }
250 #endif // End of notice for C++ compilers
251 
252 #endif // End of pixie16app_globals.h
253 
Definition: pixie16app_globals.h:85
Definition: pixie16app_globals.h:73