Line data Source code
1 : //-*- Mode: C++ -*-
2 : // $Id$
3 : #ifndef ALIHLTTPCHWCFEXTRACTORUNIT_H
4 : #define ALIHLTTPCHWCFEXTRACTORUNIT_H
5 : //* This file is property of and copyright by the ALICE HLT Project *
6 : //* ALICE Experiment at CERN, All rights reserved. *
7 : //* See cxx source for full Copyright notice *
8 :
9 : // @file AliHLTTPCHWCFExtractorUnit.h
10 : // @author Sergey Gorbunov <sergey.gorbunov@fias.uni-frankfurt.de>
11 : // @author Torsten Alt <talt@cern.ch>
12 : // @brief Channel Extractor unit of FPGA ClusterFinder Emulator for TPC
13 : // @brief ( see AliHLTTPCHWCFEmulator class )
14 : // @note
15 :
16 : #include "AliHLTDataTypes.h"
17 : #include "AliHLTTPCHWCFDataTypes.h"
18 :
19 : class AliHLTTPCHWCFExtractorUnit
20 : {
21 : public:
22 :
23 : /** standard constructor */
24 : AliHLTTPCHWCFExtractorUnit();
25 :
26 : /** destructor */
27 : ~AliHLTTPCHWCFExtractorUnit();
28 :
29 : /** initialisation **/
30 : int Init( const AliHLTUInt32_t *mapping, const AliHLTTPCClusterMCLabel *mcLabels, AliHLTUInt32_t nMCLabels );
31 :
32 : /** RCU2 flag */
33 0 : void SetRCU2Flag( bool RCU2 ){ fRCU2Flag = RCU2; }
34 :
35 : /** input stream of data **/
36 : int InputStream( AliHLTUInt32_t word );
37 :
38 : /** input "end of data" signal **/
39 : int InputEndOfData();
40 :
41 : /** output stream of data **/
42 : const AliHLTTPCHWCFBunch *OutputStream();
43 :
44 : private:
45 :
46 : enum AliHLTTPCHWCFExtractorStatus{ kReadingData, kReadingRCU, kFinishing, kStop };
47 : enum AliHLTTPCHWCFExtractorInputStatus{ kEmpty, kData, kEndOfData };
48 :
49 : /** copy constructor prohibited */
50 : AliHLTTPCHWCFExtractorUnit(const AliHLTTPCHWCFExtractorUnit&);
51 : /** assignment operator prohibited */
52 : AliHLTTPCHWCFExtractorUnit& operator=(const AliHLTTPCHWCFExtractorUnit&);
53 :
54 : AliHLTTPCHWCFExtractorStatus fStatus; // status of the unit
55 : AliHLTUInt32_t fInput; // current input
56 : AliHLTTPCHWCFExtractorInputStatus fInputStatus; // input status
57 :
58 : const AliHLTUInt32_t *fkMapping; // mapping array
59 : AliHLTTPCHWCFBunch fMemory[2]; // memory for current bunch and pending output
60 : AliHLTTPCHWCFBunch *fBunch; // current bunch
61 : bool fPendingOutput; // is there something in the output buffer
62 :
63 : AliHLTInt32_t fChannelNumWordsLeft; // n 10-bit words left in the channel
64 : AliHLTInt32_t fBunchNumWordsLeft;// n 10-bit words left in the bunch
65 : AliHLTInt32_t fBunchCurrentTime; // timebin of the curent signal
66 : bool fRCU2Flag; // do not split input data in two branches for RCU 2
67 :
68 : const AliHLTTPCClusterMCLabel *fkMCLabels; // pointer to mc labels
69 : AliHLTUInt32_t fNMCLabels; // N mc labels
70 : AliHLTUInt32_t fCurrentMCLabel; // mc label to read next
71 : };
72 :
73 : #endif
|