1 #ifndef ALITRDRAWTPSTREAM_H
2 #define ALITRDRAWTPSTREAM_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /* $Id: AliTRDrawTPStream.h 27696 2008-07-31 09:18:53Z cblume $ */
9 ///////////////////////////////////////////////////////////////////////////////////////
11 // This class provides access to pattern generated TRD raw data including //
12 // configuration data. //
14 ///////////////////////////////////////////////////////////////////////////////////////
17 #define N_REGS 433 // number of conf. registers
18 #define N_CMD 16 // number of command registers
19 #define N_RO 25 // number of command registers
20 #define N_BLOCKS 38 // number of blocks
21 #define N_BLOCKS_n 64 // number of blocks
22 #define N_PACKD_DAT 0xE0 // the max size of the packed conf., the absolute max is 256!
23 #define N_NO_BCST 3 // number of regs without broadcast
24 #define N_DMEM 0x400 // number of DMEM words
25 #define N_DBANK 0x100 // number of DBANK words
26 #define N_IMEM 0x1000 // number of IMEM words/CPU
27 #define IMEM_EMPTY 0x80000000 // mark for empty IMEM
28 #define DBANK_ADDR 0xF000 // start address of DBANK in GIO
29 #define DMEM_ADDR 0xC000 // start address of DMEM in GIO
30 #define ENDM_CONF 0x7FFF00FE // end marker for the packed configuration
34 #include "AliTRDrawStreamBase.h"
38 class AliTRDrawTPStream : public AliTRDrawStreamBase
44 const Char_t * fName; //! Name of the register
45 UInt_t fAddr; // Address in GIO of TRAP
46 UInt_t fNbits; // Number of bits, from 1 to 32
47 UInt_t fResVal; // reset value [mj]
51 const Char_t * fName; //! Name of the command register
52 UInt_t fAddr; // Address in GIO of TRAP
56 Bool_t DecodeTPdata();
57 Bool_t DecodeConfigdata();
59 Int_t ReadPacked(UInt_t *word, UInt_t *pdata, Int_t *len);
60 Int_t UnPackConfN(UInt_t *pData, Int_t maxLength);
61 Int_t SetU(UInt_t addr, UInt_t newVal);
62 Int_t AddrIsDmem(UInt_t addr);
63 Int_t AddrIsDbank(UInt_t addr);
64 UInt_t Addr2Idx(UInt_t addr);
65 const Char_t * Addr2Name(UInt_t addr); //!
66 Char_t CnfStat(UInt_t prop);
68 void DumpCnf(Int_t slv);
70 enum DbankProp {kDbankEmpty=0, kDbankHeader, kDbankData, kDbankNoB, kDbankCrc32, kDbankEheader, kScsnDat};
72 SimpleRegs fTrapReg[N_REGS]; // all TRAP configuration registers
73 CmdRegs fCmdReg[N_CMD]; // all TRAP command registers
74 CmdRegs fRoReg[N_RO]; // all TRAP command registers
77 //--------------------------------------------------------
78 AliTRDrawTPStream(Int_t rawVMajorOpt, UInt_t * pPos);
79 AliTRDrawTPStream(const AliTRDrawTPStream& st);
80 AliTRDrawTPStream &operator=(const AliTRDrawTPStream &);
81 virtual ~AliTRDrawTPStream();
82 //--------------------------------------------------------
87 UInt_t fCnfPro[N_REGS];
88 UInt_t fDmemValid[N_DMEM]; // 0- empty, 1- valid
89 UInt_t fRegs[N_REGS]; // the actual content of all conf. registers
90 UInt_t fDmem[N_DMEM]; // content of the DMEM, in GIO from 0xC000 to 0xC3FF
91 UInt_t fDbank[N_DBANK]; // 32 bit data, to be send to DBANK
92 DbankProp fDbankPro[N_DBANK]; // property: 0-empty, 1- header, 2- data, 3- data no broadcast, 4- crc-32 checksum, 5- empty header
94 UInt_t *fpPos; //! current position in the buffer
95 Int_t fRawVMajorOpt; // Raw data version
98 ClassDef(AliTRDrawTPStream, 0) // Pattern generated TRD raw data