Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/MbsAPI/s_setup.h

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

Generated on Tue Nov 8 10:56:09 2005 for Go4-v2.10-5 by doxygen1.2.15