source: Sophya/trunk/AddOn/TAcq/pciewrap.cc@ 3627

Last change on this file since 3627 was 3626, checked in by ansari, 16 years ago

Introduction numero d'ordre de remplissage, mask de recyclage,
et sequence de traitement procA/B/C dans le gestionnaire de
memoire - Reza 22/05/2009

File size: 1.3 KB
Line 
1#include "pciewrap.h"
2#include "brpaqu.h"
3
4#include "racqumem.h"
5
6#include <stdlib.h>
7#include <stdio.h>
8#include <math.h>
9#include <iostream>
10
11TestPCIWrapperNODMA::TestPCIWrapperNODMA(UInt32 sz)
12 : PCIEWrapper() , size_(sz)
13{
14 data_ = new Byte[size_];
15 frame_counter_ = 0;
16 timetag_ = 0;
17 tottransfer_ = 0;
18}
19
20TestPCIWrapperNODMA::~TestPCIWrapperNODMA()
21{
22 delete[] data_;
23}
24
25UInt32 TestPCIWrapperNODMA::TransferSize()
26{
27 return size_;
28}
29
30UInt64 TestPCIWrapperNODMA::TotTransferBytes()
31{
32 return tottransfer_;
33}
34
35Byte* TestPCIWrapperNODMA::DoTransferData(int numbuff)
36{
37 frame_counter_ ++;
38 timetag_ = frame_counter_ * size_ / 2;
39 BRPaquet paq(data_, size_);
40 paq.SetHDRMarker64(pchk_.HDRTag());
41 paq.SetTRLMarker64(pchk_.TRLTag());
42 paq.SetFrameCounter(frame_counter_);
43 paq.SetTimeTag(timetag_);
44 paq.SetPaqLen((UInt16)((size_ - BRHDRSIZE - BRTRLSIZE)/4));
45 Byte* bp = paq.Data1();
46/*
47 for(UInt32 kk=0; kk<paq.DataSize(); kk++)
48 bp[kk] = (Byte)(sin(0.0345*kk)*78.+127.5);
49*/
50 UInt32 kkmax = paq.DataSize();
51 for(UInt32 kk=0; kk<kkmax; kk++)
52 bp[kk] = (Byte)(kk%200+20);
53 tottransfer_ += size_;
54 return data_;
55}
56
57void TestPCIWrapperNODMA::PrintStatus(ostream& os)
58{
59 os << "TestPCIWrapperNODMA::Status, FrameCounter=" << frame_counter_
60 << " TimeTag=" << timetag_ << endl;
61}
Note: See TracBrowser for help on using the repository browser.