/* * hit buffer definition and vme addresses as described in Hit Buffer * Specification and Design document (SVT note n. 51) * * 7-6-1995 * * author F. Spinella * 22 April 1999: modify for Hit Buffer V2.0 by S.Belforte * added addresses etc for DipSwitches, FreezeVME, CDF_Error */ /* internal vme addresses */ #define hb_error_reg 0x000000 #define hb_init_reg 0x000004 #define hb_tmod_reg 0x000008 #define hb_hit_fifo_reg 0x00000c #define hb_road_fifo_reg 0x000010 #define hb_hold_reg 0x000014 #define hb_fsm_reg 0x000018 #define hb_fsmh_reg 0x000020 #define hb_fsmr_reg 0x000024 #define hb_output_reg 0x000028 #define hb_freezevme_reg 0x00002C #define hb_hspy_reg 0x000030 #define hb_rspy_reg 0x000034 #define hb_ospy_reg 0x000038 #define hb_erren_reg 0x000040 #define hb_cdferren_reg 0x000044 #define hb_cdferror_reg 0x000048 #define hb_dipswitch_reg 0x00004C #define hb_id_prom 0x100000 #define hb_id_prom_end 0x13ffff #define hb_hit_fifo 0x200000 #define hb_hit_fifo_end 0x20ffff #define hb_road_fifo 0x210000 #define hb_road_fifo_end 0x21ffff #define hb_hit_spy 0x280000 #define hb_hit_spy_end 0x2fffff #define hb_road_spy 0x300000 #define hb_road_spy_end 0x37ffff #define hb_out_spy 0x380000 #define hb_out_spy_end 0x3fffff #define hb_ss_map 0x400000 #define hb_ss_map_end 0x47ffff #define hb_am_map 0x800000 #define hb_am_map_end 0xbfffff #define hb_am_map_lay0 0x800000 #define hb_am_map_lay1 0x880000 #define hb_am_map_lay2 0x900000 #define hb_am_map_lay3 0x980000 #define hb_am_map_lay4 0xa00000 /* hit buffer IDPROM lenght, in words */ #define HIT_BUFFER_IDPROM_LENGHT 0x10000 /* hit buffer FIFO depth */ #define HIT_BUFFER_FIFODEPTH 4096 /* hit buffer FIFO half full depth */ #define HIT_BUFFER_FIFO_NHF_DEPTH 3968 /* hit_buffer data packets size */ /* HIT_BUFFER_PACKET_DIM should be a divisor of mergerFIFOdepth */ #define HIT_BUFFER_PACKET_DIM 64 /* hit buffer SSmap dim : */ #define HIT_BUFFER_SSMAP_LENGHT 131072 /* hit buffer AMmap dim : */ #define HIT_BUFFER_AMMAP_LENGHT 1048576 /* #define HIT_BUFFER_AMMAP_LENGHT 12 */ /* values returned from FIFOstatus functions */ #define HIT_BUFFER_FIFO_NOEMPTY 1 #define HIT_BUFFER_FIFO_NOHALFFULL 2 #define HIT_BUFFER_FIFO_NOFULL 4 /* values returned from spy buffer status registers */ #define HIT_BUFFER_FREEZE 0 #define HIT_BUFFER_SPY 1 #define HIT_BUFFER_OVERFLOW 1 #define HIT_BUFFER_NOOVERFLOW 0 /* spy buffers lenght */ #define HIT_BUFFER_SPYBUFFER_LENGHT 131072 /* * just to debug functions: * * #define HIT_BUFFER_SPYBUFFER_LENGHT 13 */ /* =============================================== */ /* hit buffer vme access internal data */ /* * HIT_BUFFER_THRESHOLD sets the value used as threshold to choose between * single word and BLT transfer types */ #define HIT_BUFFER_THRESHOLD 5 /* hit buffer status register number */ #define HIT_BUFFER_REGISTER_NUMBER 12 /* hit buffer output hold status */ #define HIT_BUFFER_OUT_NOHOLD 1 #define HIT_BUFFER_OUT_HOLD 0 /* hit buffer error flags */ #define HB_ERROR_NUMBER 8 #define HB_HIT_FIFO_OVERFLOW 0x1 #define HB_ROAD_FIFO_OVERFLOW 0x2 #define HB_HIT_PARITY_ERROR 0x4 #define HB_ROAD_PARITY_ERROR 0x8 #define HB_LOST_SYNC 0x10 #define HB_BUFFER_OVERFLOW 0x20 #define HB_INVALID_HIT 0x40 #define HB_INVALID_ROAD 0x80 const int HB_ERROR[HB_ERROR_NUMBER] = {0x1,0x2,0x4,0x8,0x10,0x20,0x40,0x80};