]>
Commit | Line | Data |
---|---|---|
242f25f2 | 1 | #ifndef ALITRDRAWTPSTREAM_H |
2 | #define ALITRDRAWTPSTREAM_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | /* $Id: AliTRDrawTPStream.h 27696 2008-07-31 09:18:53Z cblume $ */ | |
8 | ||
9 | /////////////////////////////////////////////////////////////////////////////////////// | |
10 | // // | |
11 | // This class provides access to pattern generated TRD raw data including // | |
12 | // configuration data. // | |
13 | // // | |
14 | /////////////////////////////////////////////////////////////////////////////////////// | |
15 | ||
16 | ||
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 | |
31 | ||
32 | #include "TObject.h" | |
33 | #include "TString.h" | |
34 | #include "AliTRDrawStreamBase.h" | |
35 | ||
36 | ||
37 | ||
38 | class AliTRDrawTPStream : public AliTRDrawStreamBase | |
39 | { // class def begin | |
40 | ||
41 | public: | |
42 | ||
43 | struct SimpleRegs { | |
a6e0ebfe | 44 | const Char_t * fName; //! Name of the register |
242f25f2 | 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] | |
48 | }; | |
49 | ||
50 | struct CmdRegs{ | |
a6e0ebfe | 51 | const Char_t * fName; //! Name of the command register |
242f25f2 | 52 | UInt_t fAddr; // Address in GIO of TRAP |
53 | }; | |
54 | ||
55 | ||
56 | Bool_t DecodeTPdata(); | |
57 | Bool_t DecodeConfigdata(); | |
58 | Bool_t FillConfig(); | |
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); | |
a6e0ebfe | 65 | const Char_t * Addr2Name(UInt_t addr); //! |
242f25f2 | 66 | Char_t CnfStat(UInt_t prop); |
67 | void PowerUp(); | |
68 | void DumpCnf(Int_t slv); | |
69 | ||
70 | enum DbankProp {kDbankEmpty=0, kDbankHeader, kDbankData, kDbankNoB, kDbankCrc32, kDbankEheader, kScsnDat}; | |
71 | ||
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 | |
75 | ||
76 | ||
77 | //-------------------------------------------------------- | |
78 | AliTRDrawTPStream(Int_t rawVMajorOpt, UInt_t * pPos); | |
79 | AliTRDrawTPStream(const AliTRDrawTPStream& st); | |
80 | AliTRDrawTPStream &operator=(const AliTRDrawTPStream &); | |
81 | virtual ~AliTRDrawTPStream(); | |
82 | //-------------------------------------------------------- | |
83 | ||
84 | ||
85 | protected: | |
86 | ||
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 | |
93 | ||
94 | UInt_t *fpPos; //! current position in the buffer | |
95 | Int_t fRawVMajorOpt; // Raw data version | |
96 | ||
97 | ||
98 | ClassDef(AliTRDrawTPStream, 0) // Pattern generated TRD raw data | |
99 | ||
100 | }; | |
101 | ||
102 | #endif |