00001 // $Id: s_setup.h 478 2009-10-29 12:26:09Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #include "typedefs.h" 00015 /* 00016 * N. Kurz 00017 * global SBS setup parameter structure 00018 */ 00019 00020 /* After allocating s_setup, set in f_ut_setup_ini */ 00021 /* ps_setup->l_endian = 1; */ 00022 /* ps_setup->l_version = n; */ 00023 /* ps_setup->bl_struc_len = sizeof(s_setup)/4; */ 00024 /* ps_setup->l_fix_lw = ((int)&lp_rem_mem_base[0]-(int)ps_setup)/4; */ 00025 /* ps_setup->bl_sbs__n_cr = SBS__N_CR; */ 00026 /* ps_setup->bl_sbs__n_trg_typ = SBS__N_TRG_TYP; */ 00027 00028 typedef struct 00029 { 00030 /*---------------------------------------------------------------------------*/ 00031 INTU4 l_endian; /* set to 1 */ 00032 INTU4 l_version; /* increment in f_ut_setup_ini after changes */ 00033 INTU4 bl_struc_len; /* sizeof(s_setup)/4 : length of this structure */ 00034 INTU4 l_fix_lw; /* (&lp_rem_mem_base-ps_setup)/4 : swapping size */ 00035 INTU4 bl_sbs__n_cr; /* set to SBS__N_CR */ 00036 INTU4 bl_sbs__n_trg_typ; /* set to SBS__N_TRG_TYP */ 00037 /*---------------------------------------------------------------------------*/ 00038 INTU4 bi_master; /* indicates type of master event builder */ 00039 /* meb: 1 = CVC, 2 = E6, 3 = E7 */ 00040 INTU4 bl_no_crates; /* Number of crates to read (bh_rd_flg > 0) */ 00041 INTU4 bh_crate_nr; /* crate nr. of readout processor: meb = 0, slave = 1-15 */ 00042 /* this value will be set by the load setup command and */ 00043 /* is not parsed from the .usf file */ 00044 /*---------------------------------------------------------------------------*/ 00045 INTU4 bl_ev_buf_len; /* length of single event buffer */ 00046 INTU4 bl_n_ev_buf; /* number of event buffers in a stream */ 00047 INTU4 bl_n_stream; /* number of streams */ 00048 /*---------------------------------------------------------------------------*/ 00049 INTU4 bi_evt_typ_sy; /* event type of synchronous events, default = 10 */ 00050 INTU4 bi_evt_typ_asy; /* event type of asynchronous events, default = 10 */ 00051 INTU4 bi_evt_subtyp_sy; /* event subtype of synchronous events, default = 1 */ 00052 INTU4 bi_evt_subtyp_asy; /* event subtype of asynchronous events, default = 2 */ 00053 INTS4 h_se_control; /* serves as branch identifier in a multi-branch system */ 00054 /*---------------------------------------------------------------------------*/ 00055 INTU4 bh_rd_typ; /* 0 = standard readout with readout tables */ 00056 /* 1 = user readout (function) */ 00057 /* if the following bh_meb_asy_flg is set to 1 there will be a second */ 00058 /* async. subevent pipe installed, which will be collected by the meb */ 00059 /* collector, but must be filled by a seperate process */ 00060 INTU4 bh_col_mode; /* indicates mode of this MEB collector or master readout:*/ 00061 /* 0 = standard, the collector formats events and passes */ 00062 /* the formatted event buffer streams to the */ 00063 /* transport */ 00064 /* 1 = collector collects subevents from the various */ 00065 /* SBS pipes, but no event formatting will be done. */ 00066 /* instead the collected subevents are written into a */ 00067 /* output pipe for the next layer node of the */ 00068 /* multi-branch multi-layer daq system. this mode */ 00069 /* requires bl_ml_pipe_base_addr, bl_ml_pipe_seg_len */ 00070 /* and bl_ml_pipe_len to be specified (see below). */ 00071 /* 2 = only m_read_meb and no collector runs on the */ 00072 /* SBS master (MEB). Its subevent pipe will be read */ 00073 /* by a node of the multi-branch multi-layer daq */ 00074 /* system. in this case the mb ml node gets the pipe */ 00075 /* specs from bl_pipe_seg_len and bl_pipe_len */ 00076 /* (see above). */ 00077 /* 3 = includes both 0 and 1 mode. */ 00078 /*---------------------------------------------------------------------------*/ 00079 INTU4 bl_loc_esone_base; /* base address to execute CAMAC cnafs via the ESONE */ 00080 /* window on the local crate*/ 00081 INTU4 bl_rem_esone_base; /* base address to execute CAMAC cnafs via the ESONE */ 00082 /* window on the remote crate*/ 00083 INTU4 bl_esone_off; /* offset from standard to ESONE window in bytes */ 00084 INTU4 bl_cvc_crr_off; /* offset from to the CVC CAMAC Read Register */ 00085 INTU4 bl_cvc_csr_off; /* offset to the CVC Control and Status Register */ 00086 INTU4 bl_cvc_clb_off; /* offset to the CVC CAMAC Lam Buffer */ 00087 INTU4 bl_se_meb_asy_len; /* length of the async. pipe of the master, including */ 00088 /* control and data */ 00089 INTU4 bh_meb_asy_flg; /* indicates if meb must collect must an async. pipe */ 00090 /* residing on the meb: 0 = no, 1 = yes */ 00091 INTU4 bl_ml_pipe_base_addr;/* base address of the multi-branch multi-layer daq */ 00092 /* system output pipe. */ 00093 /* only requested ig bh_col_mode = 1,2 */ 00094 INTU4 bl_ml_pipe_seg_len; /* length of the multi-branch multi-layer daq system */ 00095 /* output pipe. (total lengt of subevent pipe) */ 00096 /* only requested ig bh_col_mode = 1,2 */ 00097 INTU4 bl_ml_pipe_len; /* number of subevent/fragment slots in the multi-branch */ 00098 /* multi-layer daq system output pipe */ 00099 /* only requested ig bh_col_mode = 1,2 */ 00100 INTU4 bl_n_col_retry; /* number of retries the subevent collect process makes */ 00101 /* until giving up time slice */ 00102 /*---------------------------------------------------------------------------*/ 00103 INTU4 bh_meb_trig_mode; /* if this is set to NON zero a special mode is requested */ 00104 /* for the trigger module serving m_read_meb. */ 00105 /* this could be: */ 00106 /* NOT irq (LAM, VME irq) */ 00107 /* or NOT standard base address (VME) */ 00108 /* or NOT local crate */ 00109 /* if bh_meb_trig_mode is NOT 0 always the following two */ 00110 /* setup paramters will be taken for type and base addr. */ 00111 /* */ 00112 /* NOTE: the fast clear and conversion time will be taken */ 00113 /* from bl_trig_fct[0] and bl_trig_cvt[0] from this */ 00114 /* setup structure */ 00115 /* */ 00116 /* 0 = standard = local interrupt (CAMAC LAM, VME IRQ) */ 00117 /* 1 = special: local interrupt (CAMAC LAM, VME IRQ) */ 00118 /* 2 = special: remote VSB interrupt (not yet impleme) */ 00119 /* 3 = special: polling */ 00120 INTU4 bh_special_meb_trig_type; 00121 /* 1 = CAMAC type trigger module */ 00122 /* 2 = VME type trigger module */ 00123 /* 3 = FASTBUS type triggermodule */ 00124 INTU4 bl_special_meb_trig_base; 00125 /* base address of trigger module acting together with */ 00126 /* m_read_meb if bh_meb_trig_mode != 0 */ 00127 /* NOTE: if trigger module is remote the complete (VSB) */ 00128 /* base address must be specified. example: */ 00129 /* f0580000 for a CAMAC trigger module in crate 2 */ 00130 /* serving m_read_meb running on an E7 in a VME */ 00131 /* crate. (see sketch at end of this file) */ 00132 /*---------------------------------------------------------------------------*/ 00133 INTU4 lp_cvc_irq; /* start address of the CVC irq physical segment */ 00134 INTU4 bl_cvc_irq_len; /* length of CVC irq phys. segment */ 00135 INTU4 bl_cvc_irq_source_off;/* offset from lp_cvc_irq to the CVC irq source register */ 00136 INTU4 bl_cvc_irq_mask_off; /* offset from lp_cvc_irq to the CVC irq mask register */ 00137 /*---------------------------------------------------------------------------*/ 00138 /* all values in this section will be initalized by a loader task */ 00139 INTS4 h_rd_tab_flg; /* -1 = init and readout tables invalid (this is set by */ 00140 /* the write_sbs_setup task */ 00141 /* 0 = init and readout tables have to be modified to */ 00142 /* virtual cnafs */ 00143 /* 1 = this modification is done and must not be done */ 00144 /* before a new table was loaded */ 00145 INTU4 bl_init_read_len; /* total length of init and readout CAMAC cnaf list for */ 00146 /* all crates and trigger types (in bytes) */ 00147 /* ------------------ end of fixed block --------------------------*/ 00148 /*---------------------------------------------------------------------------*/ 00149 INTU4 lp_rem_mem_base[SBS__N_CR]; 00150 /* physical base address for accessing slave crate memory */ 00151 /* seen from the MEB (pipes). This could be the VSB */ 00152 /* base address for accessing remote crates */ 00153 INTU4 bl_rem_mem_off[SBS__N_CR]; 00154 /* offset from lp_rem_mem_base[SBS__N_CR] to the memory */ 00155 /* space of the remote slaves (seen from MEB) */ 00156 INTU4 bl_rem_mem_len[SBS__N_CR]; 00157 /* lenght of the memory address window with the physical */ 00158 /* base adress lp_rem_mem_base[SBS__N_CR] */ 00159 /*---------------------------------------------------------------------------*/ 00160 INTU4 lp_rem_cam_base[SBS__N_CR]; 00161 /* physical base address for accessing slave directly via CAMAC */ 00162 INTU4 bl_rem_cam_off[SBS__N_CR]; 00163 /* offset from lp_rem_cam_base[SBS__N_CR] to the remote */ 00164 /* CAMAC space of the slaves (seen from MEB). */ 00165 INTU4 bl_rem_cam_len[SBS__N_CR]; 00166 /* lenght of the CAMAC address window with the physical */ 00167 /*---------------------------------------------------------------------------*/ 00168 INTU4 lp_loc_mem_base[SBS__N_CR]; 00169 /* base address for accessing local crate. (could be for */ 00170 /* example local CAMAC base or extended VME base.) */ 00171 INTU4 bl_loc_mem_len[SBS__N_CR]; 00172 /* length of physical segment for accessing local crate */ 00173 /* starting from lp_loc_mem_base[SBS__N_CR]. */ 00174 /*---------------------------------------------------------------------------*/ 00175 INTU4 l_loc_pipe_type[SBS__N_CR]; 00176 /* type of subevent pipe: 0: with smem_create */ 00177 /* 1: direct mapping */ 00178 INTU4 lp_loc_pipe_base[SBS__N_CR]; 00179 /* RAM start address of the crate controller (used for */ 00180 /* location of subevent pipe) */ 00181 INTU4 bl_pipe_off[SBS__N_CR]; 00182 /* offset from lp_ram_loc_start to start of the remote */ 00183 /* communication segment slave <-> master seen from the */ 00184 /* slave in bytes = start of subevent pipe */ 00185 INTU4 bl_pipe_seg_len[SBS__N_CR]; 00186 /* length of the remote communication segment in bytes */ 00187 /* = total lengt of subevent pipe */ 00188 INTU4 bl_pipe_len[SBS__N_CR]; /* number of subevent slots in a pipe */ 00189 INTU4 bh_controller_id[SBS__N_CR]; 00190 /* bh_controller_id MUST be set for ESONE CNAF execution */ 00191 /* 1 = CVC, 2 = E6, 3 = E7, 4 = AEB, 5 = CBV, 6 = CVI */ 00192 /* 7 = CAV (Q and X inverted) */ 00193 INTU4 bh_sy_asy_flg[SBS__N_CR]; 00194 /* indicates if this crate must be readout synchronous */ 00195 /* or asynchronous: 0 = synchronous, 1 = asynchronous */ 00196 /* this flag is only valid for crates with intelligent */ 00197 /* controller. At this point it is decided wether a crate */ 00198 /* is readout sync. or async. */ 00199 INTU4 bh_trig_stat_nr[SBS__N_CR];/* CAMAC station nr. of the trigger module, must be 1 */ 00200 INTU4 bl_trig_cvt[SBS__N_CR]; /* conversion time of trigger module */ 00201 INTU4 bl_trig_fct[SBS__N_CR]; /* fast clear acceptance time of trigger module */ 00202 INTS4 i_se_typ[SBS__N_CR]; /* subevent typ, default = 10 */ 00203 INTS4 i_se_subtyp[SBS__N_CR]; /* subevent subtyp: CAMAC = 1, FASTBUS = 2 */ 00204 INTS4 i_se_procid[SBS__N_CR]; /* subevent processor id */ 00205 /*---------------------------------------------------------------------------*/ 00206 INTU4 bh_rd_flg[SBS__N_CR]; 00207 /* 0 = crate not readout */ 00208 /* 1 = crate read out by meb */ 00209 /* 2 = crate readout by intelligent crate controller */ 00210 INTU4 bl_init_tab_off[SBS__N_CR]; 00211 /* offset from start of readout table segment to the */ 00212 /* start of the init table as a function of crate number */ 00213 /* (in longwords) */ 00214 INTU4 bi_init_tab_len[SBS__N_CR]; 00215 /* lenght of the init tables. if one of this values is 0 */ 00216 /* it means that this crate must not be not initalized */ 00217 /* (in longwords) */ 00218 INTU4 bl_max_se_len[SBS__N_CR][SBS__N_TRG_TYP]; 00219 /* maximal subevent length [b] of this crate and trigger */ 00220 INTU4 bl_rd_tab_off[SBS__N_CR][SBS__N_TRG_TYP]; 00221 /* offset from start of readout table segment to the */ 00222 /* start of the readout tables as a function of crate */ 00223 /* number and trigger type (in longwords) */ 00224 INTU4 bi_rd_tab_len[SBS__N_CR][SBS__N_TRG_TYP]; 00225 /* lenght of the readout tables. if one of this values */ 00226 /* is 0 it means that this crate for this trigger type is */ 00227 /* not read out (in longwords) */ 00228 /*---------------------------------------------------------------------------*/ 00229 } s_setup; 00230 00231 /* 00232 * address offset for memory access from the master event builder to the slave 00233 * CVC's via VSB. these offsets point to the memory address 0x100000 seen 00234 * from the slave CVC, which is the beginning of the RAM of the CVC. only 00235 * longword access possible, the following offsets are given in bytes. 00236 * 00237 * in the case of accessing non local crates by CAMAC cnaf's via VSB, the 00238 * shown address offset (CAM_CRT_OFF) between two consecutive crates is 00239 * automatically included by crate number contained in the cnaf. the effective 00240 * physical offset to the cnafs is 0x08180000 00241 */ 00242 /*----------------------------------------------------------------------------! 00243 ! VSB and CAMAC memory on the CVC slaves, seen from the MEB CVC ! 00244 ! ! 00245 ! ! 00246 ! 0x8000000 0x8200000 0x8400000 ! 00247 ! | | | ! 00248 ! | | | ! 00249 ! | VSB_CRT_OFF | VSB_CRT_OFF | ! 00250 ! V S B |===================|===================|===... ! 00251 ! | 0x200000 | 0x200000 | ! 00252 ! | | | ! 00253 ! | crate|1 crate|2 ! 00254 ! | | | ! 00255 ! VSB_CAM_START | (VSB_OFF = 0x0) ! 00256 !==============>| ! 00257 ! 0x8000000 | | | ! 00258 ! | crate|1 crate|2 ! 00259 ! | | | ! 00260 ! | CAM_OFF | CAM_CRT_OFF | CAM_CRT_OFF | ! 00261 ! C A M A C |================|===================|===================|==..! 00262 ! | 0x180000 | 0x200000 | 0x200000 | ! 00263 ! | | | | ! 00264 ! | | | | ! 00265 ! 0x8000000 0x8180000 0x8380000 0x8580000 ! 00266 !----------------------------------------------------------------------------*/