Last change
on this file since 3631 was 3631, checked in by ansari, 16 years ago |
Optimisation vitesse generation paquet ds TestPCIWrapperNODMA, Reza 21/05/2009
|
File size:
1.6 KB
|
Rev | Line | |
---|
[3537] | 1 | #ifndef PCIEWRAP_H_SEEN
|
---|
| 2 | #define PCIEWRAP_H_SEEN
|
---|
[3623] | 3 | #include "brtypes.h"
|
---|
[3537] | 4 | #include "machdefs.h"
|
---|
[3623] | 5 | #include "racqumem.h"
|
---|
| 6 | #include "brpaqu.h"
|
---|
[3537] | 7 | #include <string>
|
---|
| 8 |
|
---|
| 9 | /*
|
---|
| 10 | Classe interface aux fonctions d'I/O PCIExpress
|
---|
| 11 | pour la carte de reception optique BAORadio
|
---|
| 12 | R. Ansari Juin 2008
|
---|
| 13 | */
|
---|
| 14 |
|
---|
| 15 | using namespace std;
|
---|
| 16 |
|
---|
| 17 | class PCIEWException {
|
---|
| 18 | public:
|
---|
| 19 | explicit PCIEWException(const char * m) { msg = m; }
|
---|
| 20 | explicit PCIEWException(const string& m) { msg = m; }
|
---|
[3623] | 21 | virtual ~PCIEWException() { }
|
---|
[3537] | 22 | virtual string const& Msg() const {return msg;}
|
---|
| 23 | virtual const char* what() {return msg.c_str(); }
|
---|
| 24 | private:
|
---|
| 25 | string msg;
|
---|
| 26 | };
|
---|
| 27 |
|
---|
| 28 |
|
---|
[3623] | 29 | // Classe definissant l'interface des operations transfert DMA/PCIExpress
|
---|
[3628] | 30 | class PCIEWrapperInterface {
|
---|
[3623] | 31 | public:
|
---|
| 32 | // Constructeur - fait l'initialisation
|
---|
[3628] | 33 | PCIEWrapperInterface() { }
|
---|
[3623] | 34 | // destructeur - libere la memoire allouee
|
---|
[3628] | 35 | virtual ~PCIEWrapperInterface() { }
|
---|
[3537] | 36 |
|
---|
[3623] | 37 | virtual UInt32 TransferSize() = 0;
|
---|
| 38 | virtual Byte* DoTransferData(int numbuff=0) = 0;
|
---|
| 39 | virtual UInt64 TotTransferBytes() = 0;
|
---|
| 40 | virtual void PrintStatus(ostream& os) = 0;
|
---|
| 41 | };
|
---|
[3537] | 42 |
|
---|
[3623] | 43 | // Classe de test Implementant l'interface PCIEWrapper sans DMA
|
---|
[3628] | 44 | class TestPCIWrapperNODMA : public PCIEWrapperInterface {
|
---|
[3623] | 45 | public:
|
---|
| 46 | TestPCIWrapperNODMA(UInt32 sz);
|
---|
| 47 | virtual ~TestPCIWrapperNODMA();
|
---|
| 48 |
|
---|
| 49 | virtual UInt32 TransferSize() ;
|
---|
| 50 | virtual Byte* DoTransferData(int numbuff=0) ;
|
---|
| 51 | virtual UInt64 TotTransferBytes() ;
|
---|
| 52 | virtual void PrintStatus(ostream& os) ;
|
---|
| 53 |
|
---|
| 54 | protected:
|
---|
| 55 | Byte* data_;
|
---|
[3631] | 56 | Byte* srcdata_;
|
---|
[3623] | 57 | UInt32 size_;
|
---|
| 58 | UInt32 frame_counter_;
|
---|
| 59 | UInt64 timetag_;
|
---|
| 60 | UInt64 tottransfer_;
|
---|
| 61 | BRPaqChecker pchk_;
|
---|
[3537] | 62 | };
|
---|
| 63 |
|
---|
| 64 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.