GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
s_setup.h
Go to the documentation of this file.
1 // $Id: s_setup.h 1382 2015-02-06 16:11:37Z adamczew $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "typedefs.h"
15 
16 
17 
18 /*
19  * N. Kurz
20  * global SBS setup parameter structure
21  */
22 
23 /* After allocating s_setup, set in f_ut_setup_ini */
24 /* ps_setup->l_endian = 1; */
25 /* ps_setup->l_version = n; */
26 /* ps_setup->bl_struc_len = sizeof(s_setup)/4; */
27 /* ps_setup->l_fix_lw = ((int)&lp_rem_mem_base[0]-(int)ps_setup)/4; */
28 /* ps_setup->bl_sbs__n_cr = SBS__N_CR; */
29 /* ps_setup->bl_sbs__n_trg_typ = SBS__N_TRG_TYP; */
30 
31 /* JAM note that actual setup structure depends on architecture of client machine
32  * ADDRS can be 4 or 8 byte. So we need auxiliary structures to receive
33  * setup from any architecture */
34 
35 typedef struct
36 {
37 /*---------------------------------------------------------------------------*/
38 INTU4 l_endian; /* set to 1 */
39 INTU4 l_version; /* increment in f_ut_setup_ini after changes */
40 INTU4 bl_struc_len; /* sizeof(s_setup)/4 : length of this structure */
41 INTU4 l_fix_lw; /* (&lp_rem_mem_base-ps_setup)/4 : swapping size */
42 INTU4 bl_sbs__n_cr; /* set to SBS__N_CR */
43 INTU4 bl_sbs__n_trg_typ; /* set to SBS__N_TRG_TYP */
44 /*---------------------------------------------------------------------------*/
45 INTU4 bi_master; /* indicates type of master event builder */
46  /* meb: 1 = CVC, 2 = E6, 3 = E7 */
47 INTU4 bl_no_crates; /* Number of crates to read (bh_rd_flg > 0) */
48 INTU4 bh_crate_nr; /* crate nr. of readout processor: meb = 0, slave = 1-15 */
49  /* this value will be set by the load setup command and */
50  /* is not parsed from the .usf file */
51 /*---------------------------------------------------------------------------*/
52 INTU4 bl_ev_buf_len; /* length of single event buffer */
53 INTU4 bl_n_ev_buf; /* number of event buffers in a stream */
54 INTU4 bl_n_stream; /* number of streams */
55 /*---------------------------------------------------------------------------*/
56 INTU4 bi_evt_typ_sy; /* event type of synchronous events, default = 10 */
57 INTU4 bi_evt_typ_asy; /* event type of asynchronous events, default = 10 */
58 INTU4 bi_evt_subtyp_sy; /* event subtype of synchronous events, default = 1 */
59 INTU4 bi_evt_subtyp_asy; /* event subtype of asynchronous events, default = 2 */
60 INTS4 h_se_control; /* serves as branch identifier in a multi-branch system */
61 /*---------------------------------------------------------------------------*/
62 INTU4 bh_rd_typ; /* 0 = standard readout with readout tables */
63  /* 1 = user readout (function) */
64  /* if the following bh_meb_asy_flg is set to 1 there will be a second */
65  /* async. subevent pipe installed, which will be collected by the meb */
66  /* collector, but must be filled by a seperate process */
67 INTU4 bh_col_mode; /* indicates mode of this MEB collector or master readout:*/
68  /* 0 = standard, the collector formats events and passes */
69  /* the formatted event buffer streams to the */
70  /* transport */
71  /* 1 = collector collects subevents from the various */
72  /* SBS pipes, but no event formatting will be done. */
73  /* instead the collected subevents are written into a */
74  /* output pipe for the next layer node of the */
75  /* multi-branch multi-layer daq system. this mode */
76  /* requires bl_ml_pipe_base_addr, bl_ml_pipe_seg_len */
77  /* and bl_ml_pipe_len to be specified (see below). */
78  /* 2 = only m_read_meb and no collector runs on the */
79  /* SBS master (MEB). Its subevent pipe will be read */
80  /* by a node of the multi-branch multi-layer daq */
81  /* system. in this case the mb ml node gets the pipe */
82  /* specs from bl_pipe_seg_len and bl_pipe_len */
83  /* (see above). */
84  /* 3 = includes both 0 and 1 mode. */
85 /*---------------------------------------------------------------------------*/
86 ADDRS bl_loc_esone_base; /* base address to execute CAMAC cnafs via the ESONE */
87  /* window on the local crate JAM64*/
88 ADDRS bl_rem_esone_base; /* base address to execute CAMAC cnafs via the ESONE */
89  /* window on the remote crate JAM64*/
90 INTU4 bl_esone_off; /* offset from standard to ESONE window in bytes */
91 INTU4 bl_cvc_crr_off; /* offset from to the CVC CAMAC Read Register */
92 INTU4 bl_cvc_csr_off; /* offset to the CVC Control and Status Register */
93 INTU4 bl_cvc_clb_off; /* offset to the CVC CAMAC Lam Buffer */
94 INTU4 bl_se_meb_asy_len; /* length of the async. pipe of the master, including */
95  /* control and data */
96 INTU4 bh_meb_asy_flg; /* indicates if meb must collect must an async. pipe */
97  /* residing on the meb: 0 = no, 1 = yes */
98 
99 ADDRS bl_ml_pipe_base_addr;/* base address of the multi-branch multi-layer daq JAM64 */
100  /* system output pipe. */
101  /* only requested ig bh_col_mode = 1,2 */
102 
103 ADDRS bl_ml_pipe_seg_len; /* length of the multi-branch multi-layer daq system JAM64 */
104  /* output pipe. (total lengt of subevent pipe) */
105  /* only requested ig bh_col_mode = 1,2 */
106 
107 INTU4 bl_ml_pipe_len; /* number of subevent/fragment slots in the multi-branch */
108  /* multi-layer daq system output pipe */
109  /* only requested ig bh_col_mode = 1,2 */
110 INTU4 bl_n_col_retry; /* number of retries the subevent collect process makes */
111  /* until giving up time slice */
112 /*---------------------------------------------------------------------------*/
113 INTU4 bh_meb_trig_mode; /* if this is set to NON zero a special mode is requested */
114  /* for the trigger module serving m_read_meb. */
115  /* this could be: */
116  /* NOT irq (LAM, VME irq) */
117  /* or NOT standard base address (VME) */
118  /* or NOT local crate */
119  /* if bh_meb_trig_mode is NOT 0 always the following two */
120  /* setup paramters will be taken for type and base addr. */
121  /* */
122  /* NOTE: the fast clear and conversion time will be taken */
123  /* from bl_trig_fct[0] and bl_trig_cvt[0] from this */
124  /* setup structure */
125  /* */
126  /* 0 = standard = local interrupt (CAMAC LAM, VME IRQ) */
127  /* 1 = special: local interrupt (CAMAC LAM, VME IRQ) */
128  /* 2 = special: remote VSB interrupt (not yet impleme) */
129  /* 3 = special: polling */
131  /* 1 = CAMAC type trigger module */
132  /* 2 = VME type trigger module */
133  /* 3 = FASTBUS type triggermodule */
134 
136  /* base address of trigger module acting together with */
137  /* m_read_meb if bh_meb_trig_mode != 0 */
138  /* NOTE: if trigger module is remote the complete (VSB) */
139  /* base address must be specified. example: */
140  /* f0580000 for a CAMAC trigger module in crate 2 */
141  /* serving m_read_meb running on an E7 in a VME */
142  /* crate. (see sketch at end of this file)
143  * JAM64 changed type to ADDRS*/
144 
145 
146 /*---------------------------------------------------------------------------*/
147 INTU4 lp_cvc_irq; /* start address of the CVC irq physical segment */
148 INTU4 bl_cvc_irq_len; /* length of CVC irq phys. segment */
149 INTU4 bl_cvc_irq_source_off;/* offset from lp_cvc_irq to the CVC irq source register */
150 INTU4 bl_cvc_irq_mask_off; /* offset from lp_cvc_irq to the CVC irq mask register */
151 /*---------------------------------------------------------------------------*/
152 /* all values in this section will be initalized by a loader task */
153 INTS4 h_rd_tab_flg; /* -1 = init and readout tables invalid (this is set by */
154  /* the write_sbs_setup task */
155  /* 0 = init and readout tables have to be modified to */
156  /* virtual cnafs */
157  /* 1 = this modification is done and must not be done */
158  /* before a new table was loaded */
159 INTU4 bl_init_read_len; /* total length of init and readout CAMAC cnaf list for */
160  /* all crates and trigger types (in bytes) */
161 /* ------------------ end of fixed block --------------------------*/
162 /*---------------------------------------------------------------------------*/
163 
164 
165 ADDRS lp_rem_mem_base[SBS__N_CR];
166  /* physical base address for accessing slave crate memory */
167  /* seen from the MEB (pipes). This could be the VSB */
168  /* base address for accessing remote crates */
169 ADDRS bl_rem_mem_off[SBS__N_CR];
170  /* offset from lp_rem_mem_base[SBS__N_CR] to the memory */
171  /* space of the remote slaves (seen from MEB) */
172 ADDRS bl_rem_mem_len[SBS__N_CR];
173  /* lenght of the memory address window with the physical */
174  /* base adress lp_rem_mem_base[SBS__N_CR] */
175 
176 
177 /*---------------------------------------------------------------------------*/
178 ADDRS lp_rem_cam_base[SBS__N_CR];
179  /* physical base address for accessing slave directly via CAMAC JAM64: replaced INTU4 */
180 ADDRS bl_rem_cam_off[SBS__N_CR];
181  /* offset from lp_rem_cam_base[SBS__N_CR] to the remote */
182  /* CAMAC space of the slaves (seen from MEB). JAM64: replaced INTU4 */
183 INTU4 bl_rem_cam_len[SBS__N_CR];
184  /* lenght of the CAMAC address window with the physical */
185 /*---------------------------------------------------------------------------*/
186 ADDRS lp_loc_mem_base[SBS__N_CR];
187  /* base address for accessing local crate. (could be for */
188  /* example local CAMAC base or extended VME base.) JAM64: replaced INTU4 */
189 ADDRS bl_loc_mem_len[SBS__N_CR];
190  /* length of physical segment for accessing local crate */
191  /* starting from lp_loc_mem_base[SBS__N_CR]. JAM64: replaced INTU4 */
192 /*---------------------------------------------------------------------------*/
193 INTU4 l_loc_pipe_type[SBS__N_CR];
194  /* type of subevent pipe: 0: with smem_create */
195  /* 1: direct mapping */
196 ADDRS lp_loc_pipe_base[SBS__N_CR];
197  /* RAM start address of the crate controller (used for */
198  /* location of subevent pipe) JAM64: replaced INTU4 */
199 ADDRS bl_pipe_off[SBS__N_CR];
200  /* offset from lp_ram_loc_start to start of the remote */
201  /* communication segment slave <-> master seen from the */
202  /* slave in bytes = start of subevent pipe JAM64: replaced INTU4 */
203 ADDRS bl_pipe_seg_len[SBS__N_CR];
204  /* length of the remote communication segment in bytes */
205  /* = total lengt of subevent pipe JAM64: replaced INTU4 */
206 INTU4 bl_pipe_len[SBS__N_CR]; /* number of subevent slots in a pipe */
207 INTU4 bh_controller_id[SBS__N_CR];
208  /* bh_controller_id MUST be set for ESONE CNAF execution */
209  /* 1 = CVC, 2 = E6, 3 = E7, 4 = AEB, 5 = CBV, 6 = CVI */
210  /* 7 = CAV (Q and X inverted) */
211 INTU4 bh_sy_asy_flg[SBS__N_CR];
212  /* indicates if this crate must be readout synchronous */
213  /* or asynchronous: 0 = synchronous, 1 = asynchronous */
214  /* this flag is only valid for crates with intelligent */
215  /* controller. At this point it is decided wether a crate */
216  /* is readout sync. or async. */
217 INTU4 bh_trig_stat_nr[SBS__N_CR];/* CAMAC station nr. of the trigger module, must be 1 */
218 INTU4 bl_trig_cvt[SBS__N_CR]; /* conversion time of trigger module */
219 INTU4 bl_trig_fct[SBS__N_CR]; /* fast clear acceptance time of trigger module */
220 INTS4 i_se_typ[SBS__N_CR]; /* subevent typ, default = 10 */
221 INTS4 i_se_subtyp[SBS__N_CR]; /* subevent subtyp: CAMAC = 1, FASTBUS = 2 */
222 INTS4 i_se_procid[SBS__N_CR]; /* subevent processor id */
223 /*---------------------------------------------------------------------------*/
224 INTU4 bh_rd_flg[SBS__N_CR];
225  /* 0 = crate not readout */
226  /* 1 = crate read out by meb */
227  /* 2 = crate readout by intelligent crate controller */
228 INTU4 bl_init_tab_off[SBS__N_CR];
229  /* offset from start of readout table segment to the */
230  /* start of the init table as a function of crate number */
231  /* (in longwords) */
232 INTU4 bi_init_tab_len[SBS__N_CR];
233  /* lenght of the init tables. if one of this values is 0 */
234  /* it means that this crate must not be not initalized */
235  /* (in longwords) */
237  /* maximal subevent length [b] of this crate and trigger */
239  /* offset from start of readout table segment to the */
240  /* start of the readout tables as a function of crate */
241  /* number and trigger type (in longwords) */
243  /* lenght of the readout tables. if one of this values */
244  /* is 0 it means that this crate for this trigger type is */
245  /* not read out (in longwords) */
246 /*---------------------------------------------------------------------------*/
247 } s_setup;
248 
249 
250 /* JAM this is a helper structure to receive a setup structure originated by
251  * a 32 bit architecture mbs node. All addresses are 4 byte, as in old MBS*/
252 
253 typedef struct
254 {
255 /*---------------------------------------------------------------------------*/
256 INTU4 l_endian; /* set to 1 */
257 INTU4 l_version; /* increment in f_ut_setup_ini after changes */
258 INTU4 bl_struc_len; /* sizeof(s_setup)/4 : length of this structure */
259 INTU4 l_fix_lw; /* (&lp_rem_mem_base-ps_setup)/4 : swapping size */
260 INTU4 bl_sbs__n_cr; /* set to SBS__N_CR */
261 INTU4 bl_sbs__n_trg_typ; /* set to SBS__N_TRG_TYP */
262 /*---------------------------------------------------------------------------*/
263 INTU4 bi_master; /* indicates type of master event builder */
264  /* meb: 1 = CVC, 2 = E6, 3 = E7 */
265 INTU4 bl_no_crates; /* Number of crates to read (bh_rd_flg > 0) */
266 INTU4 bh_crate_nr; /* crate nr. of readout processor: meb = 0, slave = 1-15 */
267  /* this value will be set by the load setup command and */
268  /* is not parsed from the .usf file */
269 /*---------------------------------------------------------------------------*/
270 INTU4 bl_ev_buf_len; /* length of single event buffer */
271 INTU4 bl_n_ev_buf; /* number of event buffers in a stream */
272 INTU4 bl_n_stream; /* number of streams */
273 /*---------------------------------------------------------------------------*/
274 INTU4 bi_evt_typ_sy; /* event type of synchronous events, default = 10 */
275 INTU4 bi_evt_typ_asy; /* event type of asynchronous events, default = 10 */
276 INTU4 bi_evt_subtyp_sy; /* event subtype of synchronous events, default = 1 */
277 INTU4 bi_evt_subtyp_asy; /* event subtype of asynchronous events, default = 2 */
278 INTS4 h_se_control; /* serves as branch identifier in a multi-branch system */
279 /*---------------------------------------------------------------------------*/
280 INTU4 bh_rd_typ; /* 0 = standard readout with readout tables */
281  /* 1 = user readout (function) */
282  /* if the following bh_meb_asy_flg is set to 1 there will be a second */
283  /* async. subevent pipe installed, which will be collected by the meb */
284  /* collector, but must be filled by a seperate process */
285 INTU4 bh_col_mode; /* indicates mode of this MEB collector or master readout:*/
286  /* 0 = standard, the collector formats events and passes */
287  /* the formatted event buffer streams to the */
288  /* transport */
289  /* 1 = collector collects subevents from the various */
290  /* SBS pipes, but no event formatting will be done. */
291  /* instead the collected subevents are written into a */
292  /* output pipe for the next layer node of the */
293  /* multi-branch multi-layer daq system. this mode */
294  /* requires bl_ml_pipe_base_addr, bl_ml_pipe_seg_len */
295  /* and bl_ml_pipe_len to be specified (see below). */
296  /* 2 = only m_read_meb and no collector runs on the */
297  /* SBS master (MEB). Its subevent pipe will be read */
298  /* by a node of the multi-branch multi-layer daq */
299  /* system. in this case the mb ml node gets the pipe */
300  /* specs from bl_pipe_seg_len and bl_pipe_len */
301  /* (see above). */
302  /* 3 = includes both 0 and 1 mode. */
303 /*---------------------------------------------------------------------------*/
304 INTU4 bl_loc_esone_base; /* base address to execute CAMAC cnafs via the ESONE */
305  /* window on the local crate*/
306 INTU4 bl_rem_esone_base; /* base address to execute CAMAC cnafs via the ESONE */
307  /* window on the remote crate*/
308 INTU4 bl_esone_off; /* offset from standard to ESONE window in bytes */
309 INTU4 bl_cvc_crr_off; /* offset from to the CVC CAMAC Read Register */
310 INTU4 bl_cvc_csr_off; /* offset to the CVC Control and Status Register */
311 INTU4 bl_cvc_clb_off; /* offset to the CVC CAMAC Lam Buffer */
312 INTU4 bl_se_meb_asy_len; /* length of the async. pipe of the master, including */
313  /* control and data */
314 INTU4 bh_meb_asy_flg; /* indicates if meb must collect must an async. pipe */
315  /* residing on the meb: 0 = no, 1 = yes */
316 INTU4 bl_ml_pipe_base_addr;/* base address of the multi-branch multi-layer daq */
317  /* system output pipe. */
318  /* only requested ig bh_col_mode = 1,2 */
319 INTU4 bl_ml_pipe_seg_len; /* length of the multi-branch multi-layer daq system */
320  /* output pipe. (total lengt of subevent pipe) */
321  /* only requested ig bh_col_mode = 1,2 */
322 INTU4 bl_ml_pipe_len; /* number of subevent/fragment slots in the multi-branch */
323  /* multi-layer daq system output pipe */
324  /* only requested ig bh_col_mode = 1,2 */
325 INTU4 bl_n_col_retry; /* number of retries the subevent collect process makes */
326  /* until giving up time slice */
327 /*---------------------------------------------------------------------------*/
328 INTU4 bh_meb_trig_mode; /* if this is set to NON zero a special mode is requested */
329  /* for the trigger module serving m_read_meb. */
330  /* this could be: */
331  /* NOT irq (LAM, VME irq) */
332  /* or NOT standard base address (VME) */
333  /* or NOT local crate */
334  /* if bh_meb_trig_mode is NOT 0 always the following two */
335  /* setup paramters will be taken for type and base addr. */
336  /* */
337  /* NOTE: the fast clear and conversion time will be taken */
338  /* from bl_trig_fct[0] and bl_trig_cvt[0] from this */
339  /* setup structure */
340  /* */
341  /* 0 = standard = local interrupt (CAMAC LAM, VME IRQ) */
342  /* 1 = special: local interrupt (CAMAC LAM, VME IRQ) */
343  /* 2 = special: remote VSB interrupt (not yet impleme) */
344  /* 3 = special: polling */
346  /* 1 = CAMAC type trigger module */
347  /* 2 = VME type trigger module */
348  /* 3 = FASTBUS type triggermodule */
350  /* base address of trigger module acting together with */
351  /* m_read_meb if bh_meb_trig_mode != 0 */
352  /* NOTE: if trigger module is remote the complete (VSB) */
353  /* base address must be specified. example: */
354  /* f0580000 for a CAMAC trigger module in crate 2 */
355  /* serving m_read_meb running on an E7 in a VME */
356  /* crate. (see sketch at end of this file) */
357 /*---------------------------------------------------------------------------*/
358 INTU4 lp_cvc_irq; /* start address of the CVC irq physical segment */
359 INTU4 bl_cvc_irq_len; /* length of CVC irq phys. segment */
360 INTU4 bl_cvc_irq_source_off;/* offset from lp_cvc_irq to the CVC irq source register */
361 INTU4 bl_cvc_irq_mask_off; /* offset from lp_cvc_irq to the CVC irq mask register */
362 /*---------------------------------------------------------------------------*/
363 /* all values in this section will be initalized by a loader task */
364 INTS4 h_rd_tab_flg; /* -1 = init and readout tables invalid (this is set by */
365  /* the write_sbs_setup task */
366  /* 0 = init and readout tables have to be modified to */
367  /* virtual cnafs */
368  /* 1 = this modification is done and must not be done */
369  /* before a new table was loaded */
370 INTU4 bl_init_read_len; /* total length of init and readout CAMAC cnaf list for */
371  /* all crates and trigger types (in bytes) */
372 /* ------------------ end of fixed block --------------------------*/
373 /*---------------------------------------------------------------------------*/
374 INTU4 lp_rem_mem_base[SBS__N_CR];
375  /* physical base address for accessing slave crate memory */
376  /* seen from the MEB (pipes). This could be the VSB */
377  /* base address for accessing remote crates */
378 INTU4 bl_rem_mem_off[SBS__N_CR];
379  /* offset from lp_rem_mem_base[SBS__N_CR] to the memory */
380  /* space of the remote slaves (seen from MEB) */
381 INTU4 bl_rem_mem_len[SBS__N_CR];
382  /* lenght of the memory address window with the physical */
383  /* base adress lp_rem_mem_base[SBS__N_CR] */
384 /*---------------------------------------------------------------------------*/
385 INTU4 lp_rem_cam_base[SBS__N_CR];
386  /* physical base address for accessing slave directly via CAMAC */
387 INTU4 bl_rem_cam_off[SBS__N_CR];
388  /* offset from lp_rem_cam_base[SBS__N_CR] to the remote */
389  /* CAMAC space of the slaves (seen from MEB). */
390 INTU4 bl_rem_cam_len[SBS__N_CR];
391  /* lenght of the CAMAC address window with the physical */
392 /*---------------------------------------------------------------------------*/
393 INTU4 lp_loc_mem_base[SBS__N_CR];
394  /* base address for accessing local crate. (could be for */
395  /* example local CAMAC base or extended VME base.) */
396 INTU4 bl_loc_mem_len[SBS__N_CR];
397  /* length of physical segment for accessing local crate */
398  /* starting from lp_loc_mem_base[SBS__N_CR]. */
399 /*---------------------------------------------------------------------------*/
400 INTU4 l_loc_pipe_type[SBS__N_CR];
401  /* type of subevent pipe: 0: with smem_create */
402  /* 1: direct mapping */
403 INTU4 lp_loc_pipe_base[SBS__N_CR];
404  /* RAM start address of the crate controller (used for */
405  /* location of subevent pipe) */
406 INTU4 bl_pipe_off[SBS__N_CR];
407  /* offset from lp_ram_loc_start to start of the remote */
408  /* communication segment slave <-> master seen from the */
409  /* slave in bytes = start of subevent pipe */
410 INTU4 bl_pipe_seg_len[SBS__N_CR];
411  /* length of the remote communication segment in bytes */
412  /* = total lengt of subevent pipe */
413 INTU4 bl_pipe_len[SBS__N_CR]; /* number of subevent slots in a pipe */
414 INTU4 bh_controller_id[SBS__N_CR];
415  /* bh_controller_id MUST be set for ESONE CNAF execution */
416  /* 1 = CVC, 2 = E6, 3 = E7, 4 = AEB, 5 = CBV, 6 = CVI */
417  /* 7 = CAV (Q and X inverted) */
418 INTU4 bh_sy_asy_flg[SBS__N_CR];
419  /* indicates if this crate must be readout synchronous */
420  /* or asynchronous: 0 = synchronous, 1 = asynchronous */
421  /* this flag is only valid for crates with intelligent */
422  /* controller. At this point it is decided wether a crate */
423  /* is readout sync. or async. */
424 INTU4 bh_trig_stat_nr[SBS__N_CR];/* CAMAC station nr. of the trigger module, must be 1 */
425 INTU4 bl_trig_cvt[SBS__N_CR]; /* conversion time of trigger module */
426 INTU4 bl_trig_fct[SBS__N_CR]; /* fast clear acceptance time of trigger module */
427 INTS4 i_se_typ[SBS__N_CR]; /* subevent typ, default = 10 */
428 INTS4 i_se_subtyp[SBS__N_CR]; /* subevent subtyp: CAMAC = 1, FASTBUS = 2 */
429 INTS4 i_se_procid[SBS__N_CR]; /* subevent processor id */
430 /*---------------------------------------------------------------------------*/
431 INTU4 bh_rd_flg[SBS__N_CR];
432  /* 0 = crate not readout */
433  /* 1 = crate read out by meb */
434  /* 2 = crate readout by intelligent crate controller */
435 INTU4 bl_init_tab_off[SBS__N_CR];
436  /* offset from start of readout table segment to the */
437  /* start of the init table as a function of crate number */
438  /* (in longwords) */
439 INTU4 bi_init_tab_len[SBS__N_CR];
440  /* lenght of the init tables. if one of this values is 0 */
441  /* it means that this crate must not be not initalized */
442  /* (in longwords) */
444  /* maximal subevent length [b] of this crate and trigger */
446  /* offset from start of readout table segment to the */
447  /* start of the readout tables as a function of crate */
448  /* number and trigger type (in longwords) */
450  /* lenght of the readout tables. if one of this values */
451  /* is 0 it means that this crate for this trigger type is */
452  /* not read out (in longwords) */
453 /*---------------------------------------------------------------------------*/
455 
456 
457 /* JAM this is a helper structure to receive a setup structure originated by
458  * a 64 bit architecture mbs node. All addresses are long long*/
459 typedef struct
460 {
461 /*---------------------------------------------------------------------------*/
462 INTU4 l_endian; /* set to 1 */
463 INTU4 l_version; /* increment in f_ut_setup_ini after changes */
464 INTU4 bl_struc_len; /* sizeof(s_setup)/4 : length of this structure */
465 INTU4 l_fix_lw; /* (&lp_rem_mem_base-ps_setup)/4 : swapping size */
466 INTU4 bl_sbs__n_cr; /* set to SBS__N_CR */
467 INTU4 bl_sbs__n_trg_typ; /* set to SBS__N_TRG_TYP */
468 /*---------------------------------------------------------------------------*/
469 INTU4 bi_master; /* indicates type of master event builder */
470  /* meb: 1 = CVC, 2 = E6, 3 = E7 */
471 INTU4 bl_no_crates; /* Number of crates to read (bh_rd_flg > 0) */
472 INTU4 bh_crate_nr; /* crate nr. of readout processor: meb = 0, slave = 1-15 */
473  /* this value will be set by the load setup command and */
474  /* is not parsed from the .usf file */
475 /*---------------------------------------------------------------------------*/
476 INTU4 bl_ev_buf_len; /* length of single event buffer */
477 INTU4 bl_n_ev_buf; /* number of event buffers in a stream */
478 INTU4 bl_n_stream; /* number of streams */
479 /*---------------------------------------------------------------------------*/
480 INTU4 bi_evt_typ_sy; /* event type of synchronous events, default = 10 */
481 INTU4 bi_evt_typ_asy; /* event type of asynchronous events, default = 10 */
482 INTU4 bi_evt_subtyp_sy; /* event subtype of synchronous events, default = 1 */
483 INTU4 bi_evt_subtyp_asy; /* event subtype of asynchronous events, default = 2 */
484 INTS4 h_se_control; /* serves as branch identifier in a multi-branch system */
485 /*---------------------------------------------------------------------------*/
486 INTU4 bh_rd_typ; /* 0 = standard readout with readout tables */
487  /* 1 = user readout (function) */
488  /* if the following bh_meb_asy_flg is set to 1 there will be a second */
489  /* async. subevent pipe installed, which will be collected by the meb */
490  /* collector, but must be filled by a seperate process */
491 INTU4 bh_col_mode; /* indicates mode of this MEB collector or master readout:*/
492  /* 0 = standard, the collector formats events and passes */
493  /* the formatted event buffer streams to the */
494  /* transport */
495  /* 1 = collector collects subevents from the various */
496  /* SBS pipes, but no event formatting will be done. */
497  /* instead the collected subevents are written into a */
498  /* output pipe for the next layer node of the */
499  /* multi-branch multi-layer daq system. this mode */
500  /* requires bl_ml_pipe_base_addr, bl_ml_pipe_seg_len */
501  /* and bl_ml_pipe_len to be specified (see below). */
502  /* 2 = only m_read_meb and no collector runs on the */
503  /* SBS master (MEB). Its subevent pipe will be read */
504  /* by a node of the multi-branch multi-layer daq */
505  /* system. in this case the mb ml node gets the pipe */
506  /* specs from bl_pipe_seg_len and bl_pipe_len */
507  /* (see above). */
508  /* 3 = includes both 0 and 1 mode. */
509 /*---------------------------------------------------------------------------*/
510 ADDR64 bl_loc_esone_base; /* base address to execute CAMAC cnafs via the ESONE */
511  /* window on the local crate JAM64*/
512 ADDR64 bl_rem_esone_base; /* base address to execute CAMAC cnafs via the ESONE */
513  /* window on the remote crate JAM64*/
514 INTU4 bl_esone_off; /* offset from standard to ESONE window in bytes */
515 INTU4 bl_cvc_crr_off; /* offset from to the CVC CAMAC Read Register */
516 INTU4 bl_cvc_csr_off; /* offset to the CVC Control and Status Register */
517 INTU4 bl_cvc_clb_off; /* offset to the CVC CAMAC Lam Buffer */
518 INTU4 bl_se_meb_asy_len; /* length of the async. pipe of the master, including */
519  /* control and data */
520 INTU4 bh_meb_asy_flg; /* indicates if meb must collect must an async. pipe */
521  /* residing on the meb: 0 = no, 1 = yes */
522 
523 ADDR64 bl_ml_pipe_base_addr;/* base address of the multi-branch multi-layer daq JAM64 */
524  /* system output pipe. */
525  /* only requested ig bh_col_mode = 1,2 */
526 
527 ADDR64 bl_ml_pipe_seg_len; /* length of the multi-branch multi-layer daq system JAM64 */
528  /* output pipe. (total lengt of subevent pipe) */
529  /* only requested ig bh_col_mode = 1,2 */
530 
531 INTU4 bl_ml_pipe_len; /* number of subevent/fragment slots in the multi-branch */
532  /* multi-layer daq system output pipe */
533  /* only requested ig bh_col_mode = 1,2 */
534 INTU4 bl_n_col_retry; /* number of retries the subevent collect process makes */
535  /* until giving up time slice */
536 /*---------------------------------------------------------------------------*/
537 INTU4 bh_meb_trig_mode; /* if this is set to NON zero a special mode is requested */
538  /* for the trigger module serving m_read_meb. */
539  /* this could be: */
540  /* NOT irq (LAM, VME irq) */
541  /* or NOT standard base address (VME) */
542  /* or NOT local crate */
543  /* if bh_meb_trig_mode is NOT 0 always the following two */
544  /* setup paramters will be taken for type and base addr. */
545  /* */
546  /* NOTE: the fast clear and conversion time will be taken */
547  /* from bl_trig_fct[0] and bl_trig_cvt[0] from this */
548  /* setup structure */
549  /* */
550  /* 0 = standard = local interrupt (CAMAC LAM, VME IRQ) */
551  /* 1 = special: local interrupt (CAMAC LAM, VME IRQ) */
552  /* 2 = special: remote VSB interrupt (not yet impleme) */
553  /* 3 = special: polling */
555  /* 1 = CAMAC type trigger module */
556  /* 2 = VME type trigger module */
557  /* 3 = FASTBUS type triggermodule */
558 
560  /* base address of trigger module acting together with */
561  /* m_read_meb if bh_meb_trig_mode != 0 */
562  /* NOTE: if trigger module is remote the complete (VSB) */
563  /* base address must be specified. example: */
564  /* f0580000 for a CAMAC trigger module in crate 2 */
565  /* serving m_read_meb running on an E7 in a VME */
566  /* crate. (see sketch at end of this file)
567  * JAM64 changed type to ADDRS*/
568 
569 
570 /*---------------------------------------------------------------------------*/
571 INTU4 lp_cvc_irq; /* start address of the CVC irq physical segment */
572 INTU4 bl_cvc_irq_len; /* length of CVC irq phys. segment */
573 INTU4 bl_cvc_irq_source_off;/* offset from lp_cvc_irq to the CVC irq source register */
574 INTU4 bl_cvc_irq_mask_off; /* offset from lp_cvc_irq to the CVC irq mask register */
575 /*---------------------------------------------------------------------------*/
576 /* all values in this section will be initalized by a loader task */
577 INTS4 h_rd_tab_flg; /* -1 = init and readout tables invalid (this is set by */
578  /* the write_sbs_setup task */
579  /* 0 = init and readout tables have to be modified to */
580  /* virtual cnafs */
581  /* 1 = this modification is done and must not be done */
582  /* before a new table was loaded */
583 INTU4 bl_init_read_len; /* total length of init and readout CAMAC cnaf list for */
584  /* all crates and trigger types (in bytes) */
585 /* ------------------ end of fixed block --------------------------*/
586 
588 
589 
590 
591 
592 
593 
594 /*
595 * address offset for memory access from the master event builder to the slave
596 * CVC's via VSB. these offsets point to the memory address 0x100000 seen
597 * from the slave CVC, which is the beginning of the RAM of the CVC. only
598 * longword access possible, the following offsets are given in bytes.
599 *
600 * in the case of accessing non local crates by CAMAC cnaf's via VSB, the
601 * shown address offset (CAM_CRT_OFF) between two consecutive crates is
602 * automatically included by crate number contained in the cnaf. the effective
603 * physical offset to the cnafs is 0x08180000
604 */
605 /*----------------------------------------------------------------------------!
606 ! VSB and CAMAC memory on the CVC slaves, seen from the MEB CVC !
607 ! !
608 ! !
609 ! 0x8000000 0x8200000 0x8400000 !
610 ! | | | !
611 ! | | | !
612 ! | VSB_CRT_OFF | VSB_CRT_OFF | !
613 ! V S B |===================|===================|===... !
614 ! | 0x200000 | 0x200000 | !
615 ! | | | !
616 ! | crate|1 crate|2 !
617 ! | | | !
618 ! VSB_CAM_START | (VSB_OFF = 0x0) !
619 !==============>| !
620 ! 0x8000000 | | | !
621 ! | crate|1 crate|2 !
622 ! | | | !
623 ! | CAM_OFF | CAM_CRT_OFF | CAM_CRT_OFF | !
624 ! C A M A C |================|===================|===================|==..!
625 ! | 0x180000 | 0x200000 | 0x200000 | !
626 ! | | | | !
627 ! | | | | !
628 ! 0x8000000 0x8180000 0x8380000 0x8580000 !
629 !----------------------------------------------------------------------------*/
INTU4 bh_crate_nr
Definition: s_setup.h:48
INTU4 bl_n_col_retry
Definition: s_setup.h:534
INTU4 bl_sbs__n_trg_typ
Definition: s_setup.h:467
INTU4 bh_special_meb_trig_type
Definition: s_setup.h:554
INTU4 bl_cvc_crr_off
Definition: s_setup.h:91
INTU4 bl_se_meb_asy_len
Definition: s_setup.h:518
INTU4 l_fix_lw
Definition: s_setup.h:41
INTU4 bl_rem_esone_base
Definition: s_setup.h:306
INTU4 bi_master
Definition: s_setup.h:45
INTU4 bi_evt_subtyp_asy
Definition: s_setup.h:483
ADDRS bl_special_meb_trig_base
Definition: s_setup.h:135
#define SBS__N_TRG_TYP
Definition: sbs_def.h:25
INTU4 bl_sbs__n_trg_typ
Definition: s_setup.h:261
INTU4 bl_special_meb_trig_base
Definition: s_setup.h:349
INTU4 bl_no_crates
Definition: s_setup.h:47
INTU4 bi_evt_subtyp_asy
Definition: s_setup.h:59
INTU4 bh_meb_asy_flg
Definition: s_setup.h:520
INTU4 bl_ml_pipe_len
Definition: s_setup.h:531
INTU4 bh_meb_trig_mode
Definition: s_setup.h:113
INTU4 bl_se_meb_asy_len
Definition: s_setup.h:312
INTU4 bl_init_read_len
Definition: s_setup.h:370
INTU4 bl_cvc_irq_source_off
Definition: s_setup.h:360
INTU4 bh_col_mode
Definition: s_setup.h:67
INTU4 bl_n_ev_buf
Definition: s_setup.h:53
INTU4 bh_meb_asy_flg
Definition: s_setup.h:96
INTU4 bl_ml_pipe_seg_len
Definition: s_setup.h:319
INTU4 bl_se_meb_asy_len
Definition: s_setup.h:94
INTS4 h_rd_tab_flg
Definition: s_setup.h:153
INTU4 bl_cvc_irq_mask_off
Definition: s_setup.h:361
INTU4 bl_cvc_csr_off
Definition: s_setup.h:92
ADDRS bl_ml_pipe_seg_len
Definition: s_setup.h:103
INTU4 bl_cvc_irq_len
Definition: s_setup.h:572
INTU4 bh_meb_trig_mode
Definition: s_setup.h:537
INTU4 bi_evt_typ_asy
Definition: s_setup.h:481
INTU4 bl_ml_pipe_len
Definition: s_setup.h:107
unsigned int INTU4
Definition: typedefs.h:29
INTU4 bl_n_col_retry
Definition: s_setup.h:325
INTU4 bl_esone_off
Definition: s_setup.h:90
int INTS4
Definition: typedefs.h:28
INTU4 bl_ml_pipe_len
Definition: s_setup.h:322
INTU4 bl_struc_len
Definition: s_setup.h:40
INTU4 bl_cvc_clb_off
Definition: s_setup.h:517
INTU4 bl_ml_pipe_base_addr
Definition: s_setup.h:316
INTU4 bl_cvc_csr_off
Definition: s_setup.h:516
INTU4 bi_evt_typ_asy
Definition: s_setup.h:57
INTU4 bl_cvc_irq_mask_off
Definition: s_setup.h:150
INTU4 bl_n_stream
Definition: s_setup.h:54
ADDR64 bl_ml_pipe_base_addr
Definition: s_setup.h:523
#define SBS__N_CR
Definition: sbs_def.h:24
INTU4 bh_special_meb_trig_type
Definition: s_setup.h:345
ADDRS bl_ml_pipe_base_addr
Definition: s_setup.h:99
INTU4 bl_n_col_retry
Definition: s_setup.h:110
INTU4 bl_cvc_irq_len
Definition: s_setup.h:359
INTU4 bl_cvc_irq_source_off
Definition: s_setup.h:149
INTU4 bl_loc_esone_base
Definition: s_setup.h:304
INTU4 bl_init_read_len
Definition: s_setup.h:583
INTU4 l_version
Definition: s_setup.h:39
INTU4 bl_sbs__n_trg_typ
Definition: s_setup.h:43
INTU4 bi_evt_subtyp_asy
Definition: s_setup.h:277
INTU4 bl_cvc_clb_off
Definition: s_setup.h:93
INTU4 bi_evt_subtyp_sy
Definition: s_setup.h:276
INTU4 bi_evt_subtyp_sy
Definition: s_setup.h:58
INTU4 bl_ev_buf_len
Definition: s_setup.h:52
INTU4 bh_meb_trig_mode
Definition: s_setup.h:328
ADDRS bl_loc_esone_base
Definition: s_setup.h:86
INTU4 bi_evt_subtyp_sy
Definition: s_setup.h:482
INTU4 bi_evt_typ_sy
Definition: s_setup.h:56
INTU4 bi_evt_typ_asy
Definition: s_setup.h:275
INTS4 h_se_control
Definition: s_setup.h:60
INTU4 bh_meb_asy_flg
Definition: s_setup.h:314
INTU4 bl_cvc_irq_len
Definition: s_setup.h:148
ADDR64 bl_rem_esone_base
Definition: s_setup.h:512
INTU4 l_endian
Definition: s_setup.h:38
INTU4 bl_cvc_clb_off
Definition: s_setup.h:311
INTU4 lp_cvc_irq
Definition: s_setup.h:147
INTU4 bl_cvc_crr_off
Definition: s_setup.h:515
INTU4 bl_cvc_crr_off
Definition: s_setup.h:309
ADDR64 bl_loc_esone_base
Definition: s_setup.h:510
INTU4 bl_init_read_len
Definition: s_setup.h:159
INTU4 bl_sbs__n_cr
Definition: s_setup.h:42
ADDRS bl_rem_esone_base
Definition: s_setup.h:88
INTU4 bl_cvc_csr_off
Definition: s_setup.h:310
ADDR64 bl_ml_pipe_seg_len
Definition: s_setup.h:527
INTU4 bl_cvc_irq_mask_off
Definition: s_setup.h:574
INTU4 bh_rd_typ
Definition: s_setup.h:62
ADDR64 bl_special_meb_trig_base
Definition: s_setup.h:559
INTU4 bl_cvc_irq_source_off
Definition: s_setup.h:573
INTU4 bh_special_meb_trig_type
Definition: s_setup.h:130