Commit efc9b89c authored by dauncey's avatar dauncey

Throttling and exceeding

parent 56642b92
......@@ -19,6 +19,9 @@ public:
void boj(const BeSlinkSim &b, unsigned nHistory=100000) {
fBeSlinkSim=&b;
fPreviousThrottleActive=false;
fRaisedThrottleBx=-1;
fEndedThrottleBx=-1;
std::ostringstream sout;
sout << "BeSlinkAna" << std::setw(2) << std::setfill('0')
......@@ -26,15 +29,7 @@ public:
std::string sHgcroc[18]={"00","01","02","03","04","05","06","07","08",
"09","10","11","12","13","14","15","16","17"};
/*
hBitmapWordsVsChannels=new TH1I((sout.str()+"BitmapWordsVsChannels").c_str(),
";Number of channels per HGCROC packet;Number of words per HGCROC packet",73,-0.5,72.5);
hLabelsWordsVsChannels=new TH1I((sout.str()+"LabelsWordsVsChannels").c_str(),
";Number of channels per HGCROC packet;Number of words per HGCROC packet",73,-0.5,72.5);
hTotalChannels=new TH1D((sout.str()+"TotalChannels").c_str(),
";ECON total number of channels",1300,0,1300);
*/
hTotalEventWords=new TH1D((sout.str()+"TotalEventWords").c_str(),
";Total number of bytes per event",250,0,4000);
......@@ -46,45 +41,22 @@ public:
";Number of event buffer words used",1000,0,10000);
hEventBufferUsedHistory[e][b]=new TH1I((sout.str()+"Econ"+sHgcroc[e]+"Block"+sHgcroc[b]+"EventBufferUsedHistory").c_str(),
";BX;Number of event buffer words used",nHistory,0,nHistory);
hEventBufferExceeded[e][b]=new TH1D((sout.str()+"Econ"+sHgcroc[e]+"Block"+sHgcroc[b]+"EventBufferExceeded").c_str(),
";Number of event buffer words used",1000,0,10000);
}
}
/*
for(unsigned h(0);h<18;h++) {
hChannels[h]=new TH1D((sout.str()+"Hgcroc"+sHgcroc[h]+"Channels").c_str(),
";Number of channels per HGCROC packet",73,0,73);
hWords[h]=new TH1D((sout.str()+"Hgcroc"+sHgcroc[h]+"Words").c_str(),
";Number of words per HGCROC packet",60,0,60);
hWordsVsChannels[h]=new TH2D((sout.str()+"Hgcroc"+sHgcroc[h]+"WordsVsChannels").c_str(),
";Number of channels per HGCROC packet;Number of words per HGCROC packet",73,-0.5,72.5,60,-0.5,59.5);
}
*/
hThrottleActiveHistory=new TH1I((sout.str()+"ThrottleActiveHistory").c_str(),
";BX;Throttle active",nHistory,0,nHistory);
hRaisedThrottleToL1Accept=new TH1D((sout.str()+"RaisedThrottleToL1Accept").c_str(),
";L1Accept - ended throttle (BX)",1000,0,1000);
hEndedThrottleToL1Accept=new TH1D((sout.str()+"EndedThrottleToL1Accept").c_str(),
";L1Accept - ended throttle (BX)",1000,0,1000);
}
void analyseL1Accept(uint64_t bx) {
/*
unsigned nChannels(0),nWords(0);
for(unsigned h(0);h<18;h++) {
hChannels[h]->Fill(fEconSim->numberOfChannels(h));
hWords[h]->Fill(fEconSim->numberOfWords(h));
hWordsVsChannels[h]->Fill(fEconSim->numberOfChannels(h),fEconSim->numberOfWords(h));
nChannels+=fEconSim->numberOfChannels(h);
nWords+=fEconSim->numberOfWords(h);
}
hTotalChannels->Fill(nChannels);
hTotalWords->Fill(nWords);
for(unsigned block(0);block<fEconSim->fEconArch.fNumberOfBlocks;block++) {
unsigned nBlockChannels(0),nBlockWords(0);
for(unsigned i(0);i<fEconSim->fEconArch.fHgcrocNumber[block].size();i++) {
unsigned h(fEconSim->fEconArch.fHgcrocNumber[block][i]);
nBlockChannels+=fEconSim->numberOfChannels(h);
nBlockWords+=fEconSim->numberOfWords(h);
}
hBlockTotalChannels[block]->Fill(nBlockChannels);
hBlockTotalWords[block]->Fill(nBlockWords);
}
*/
if(fRaisedThrottleBx!=-1) hRaisedThrottleToL1Accept->Fill(bx-fRaisedThrottleBx);
if(fEndedThrottleBx!=-1) hEndedThrottleToL1Accept->Fill(bx-fEndedThrottleBx);
}
void analyseBx(uint64_t bx) {
......@@ -94,12 +66,22 @@ public:
for(unsigned b(0);b<econArch.numberOfBlocks();b++) {
hEventBufferUsed[e][b]->Fill(fBeSlinkSim->fEventBuffer[e][b].used());
hEventBufferUsedHistory[e][b]->Fill(bx,fBeSlinkSim->fEventBuffer[e][b].used());
if(fBeSlinkSim->exceededBuffer()) hEventBufferExceeded[e][b]->Fill(fBeSlinkSim->fEventBuffer[e][b].used());
}
}
if(fBeSlinkSim->fL1AcceptEoe) {
hTotalEventWords->Fill(16*fBeSlinkSim->fTotalNumberOfEventWords);
}
if(fBeSlinkSim->fThrottleActive) {
if(!fPreviousThrottleActive) fRaisedThrottleBx=bx;
hThrottleActiveHistory->Fill(bx);
} else {
if(fPreviousThrottleActive) fEndedThrottleBx=bx;
}
fPreviousThrottleActive=fBeSlinkSim->fThrottleActive;
}
void eoj() {
......@@ -108,24 +90,18 @@ public:
private:
const BeSlinkSim *fBeSlinkSim;
//TH1I *hBitmapWordsVsChannels;
//TH1I *hLabelsWordsVsChannels;
//TH1D *hMeans;
bool fPreviousThrottleActive;
uint64_t fRaisedThrottleBx;
uint64_t fEndedThrottleBx;
//TH1D *hChannels[18];
//TH1D *hWords[18];
//TH2D *hWordsVsChannels[18];
//TH1D *hTotalChannels;
//TH1D *hTotalWords;
//TH1D *hBlockTotalChannels[7];
//TH1D *hBlockTotalWords[7];
TH1D *hTotalEventWords;
TH1I *hThrottleActiveHistory;
TH1D *hRaisedThrottleToL1Accept;
TH1D *hEndedThrottleToL1Accept;
TH1D *hEventBufferUsed[Dimensions::MaxNumberOfEconsPerSlink][Dimensions::MaxNumberOfBlocksPerEcon];
TH1I *hEventBufferUsedHistory[Dimensions::MaxNumberOfEconsPerSlink][Dimensions::MaxNumberOfBlocksPerEcon];
TH1D *hEventBufferExceeded[Dimensions::MaxNumberOfEconsPerSlink][Dimensions::MaxNumberOfBlocksPerEcon];
};
#endif
......@@ -15,50 +15,48 @@ class BeSlinkSim {
public:
/*
enum {
enum {
NumberOfParallelBuffers=2
};
};
enum DataRandomMethod {
enum DataRandomMethod {
NotRandom,
Binomial,
Flat,
Mixed
};
};
enum DataFormatMethod {
enum DataFormatMethod {
FixedChannelBitmap,
FixedChannelLabels,
FixedMixture,
VariableMixture
};
};
enum DataFlowMethod {
enum DataFlowMethod {
FixedHgcrocMap,
VariableHgcrocMap,
EventBuild
};
};
*/
//BeSlinkSim(unsigned e, unsigned h=18, unsigned m=0) : fEcon(e) {
BeSlinkSim() {
}
void boj(const SlinkArch &a) {
//fSlink=a.slinkNumber();
void boj(const SlinkArch &a, unsigned bl) {
fSlinkArch=&a;
fBufferLimit=bl;
if(fPrintLevel>0) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "]::ctor() "
<< "Entered" << std::endl;
<< "Entered with buffer limit = " << fBufferLimit << std::endl;
}
fThrottleActive=false;
fEventActive=false;
fActiveInputBuffer=0;
fWriteElink=0;
//fBufferLimit=1048;
fBufferLimit=1000000000;
fArrayWrite=0;
for(unsigned i(0);i<4;i++) fArrayWord[i]=0;
......@@ -89,82 +87,29 @@ public:
void processBx(uint64_t bx, const SlinkElinkData &d) {
//#define OLD_METHOD
#ifdef OLD_METHOD
if((bx%2)==0) {
fSlinkElinkData=d;
fExceededBuffer=false;
for(unsigned e(0);e<fSlinkArch->numberOfEcons();e++) {
const EconArch &econArch(fSlinkArch->econArch(e));
} else {
uint64_t word,word2;
#endif
for(unsigned e(0);e<fSlinkArch->numberOfEcons();e++) {
const EconArch &econArch(fSlinkArch->econArch(e));
for(unsigned b(0);b<econArch.numberOfBlocks();b++) {
const std::vector<unsigned> &elinkNumber(econArch.elinkNumber(b));
#ifdef OLD_METHOD
unsigned eo(0);
for(unsigned w(0);w<elinkNumber.size();w++) {
if((eo%2)==0) {
word=fSlinkElinkData.fData[e][elinkNumber[w]];
} else {
word2=fSlinkElinkData.fData[e][elinkNumber[w]];
word+=(word2<<32);
//if(word!=0) assert(fEventBuffer[e][fSlinkArch->econArch(e).numberOfBlocks()==1?0:w].writeAndIncrementPtr(word));
if(word!=0) assert(fEventBuffer[e][b].writeAndIncrementPtr(word));
}
eo++;
}
for(unsigned w(0);w<elinkNumber.size();w++) {
if((eo%2)==0) {
word=d.fData[e][elinkNumber[w]];
} else {
word2=d.fData[e][elinkNumber[w]];
word+=(word2<<32);
//if(word!=0) assert(fEventBuffer[e][fSlinkArch->econArch(e).numberOfBlocks()==1?0:w].writeAndIncrementPtr(word));
if(word!=0) assert(fEventBuffer[e][b].writeAndIncrementPtr(word));
}
eo++;
}
/*
// DO BY ARCH PROPERLY!!!
for(unsigned w(0);w<Dimensions::MaxNumberOfElinksPerEcon;w++) {
word=fSlinkElinkData.fData[e][w];
if(word!=0) assert(fEventBuffer[e][fSlinkArch->econArch(e).numberOfBlocks()==1?0:w].writeAndIncrementPtr(word));
}
for(unsigned w(0);w<Dimensions::MaxNumberOfElinksPerEcon;w++) {
word=d.fData[e][w];
//word=(word<<32)+fSlinkElinkData.fData[e][w];
if(word!=0) assert(fEventBuffer[e][fSlinkArch->econArch(e).numberOfBlocks()==1?0:w].writeAndIncrementPtr(word));
}
*/
}
#else
for(unsigned b(0);b<econArch.numberOfBlocks();b++) {
const std::vector<unsigned> &elinkNumber(econArch.elinkNumber(b));
uint32_t word;
for(unsigned w(0);w<elinkNumber.size();w++) {
word=d.fData[e][elinkNumber[w]];
if(word!=0 || fEventBuffer[e][b].isCachedWriteWord()) assert(fEventBuffer[e][b].halfWriteAndIncrementPtr(word));
}
#endif
//processEconBx(e,d.fData[e]);
if(fEventBuffer[e][b].used()>=4095) fExceededBuffer=true;
}
}
// Output to Slink
fL1AcceptBoe=false;
fL1AcceptEoe=false;
bool done(false);
uint128_t w;
fNumberOfSlinkWords=0;
......@@ -251,336 +196,368 @@ public:
uint32_t nextWord(0);
assert(fEventBuffer[fEconRead][fBlockRead].halfReadAndIncrementPtr(nextWord));
#endif
if(nextWord!=0) {
if(fPrintLevel>5) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "]::processBx() "
<< "Read buffer words = 0x" << std::hex
<< nextWord << std::dec << std::endl;
}
if(nextWord!=0) {
if(fPrintLevel>5) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "]::processBx() "
<< "Read buffer words = 0x" << std::hex
<< nextWord << std::dec << std::endl;
}
fArrayWord[fArrayWrite]=nextWord;
fArrayWrite++;
fArrayWord[fArrayWrite]=nextWord;
fArrayWrite++;
if(fBlockCheck[fEconRead][fBlockRead].processBx(fArrayWord[fArrayWrite-1])) fBlockRead++;
if(fBlockCheck[fEconRead][fBlockRead].processBx(fArrayWord[fArrayWrite-1])) fBlockRead++;
if(fBlockRead==fSlinkArch->econArch(fEconRead).numberOfBlocks()) {
fBlockRead=0;
fEconRead++;
}
if(fBlockRead==fSlinkArch->econArch(fEconRead).numberOfBlocks()) {
fBlockRead=0;
fEconRead++;
}
if(fEconRead==fSlinkArch->numberOfEcons()) fArrayWrite=4;
}
if(fEconRead==fSlinkArch->numberOfEcons()) fArrayWrite=4;
}
} else {
if(fPrintLevel>5) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "]::processBx() "
<< "Nothing in buffer" << std::endl;
}
} else {
if(fPrintLevel>5) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "]::processBx() "
<< "Nothing in buffer" << std::endl;
}
done=true;
done=true;
}
}
}
if(fArrayWrite==4) {
w.first=fArrayWord[1];
w.first=(w.first<<32)+fArrayWord[0];
w.second=fArrayWord[3];
w.second=(w.second<<32)+fArrayWord[2];
fSlinkWord[fNumberOfSlinkWords]=std::pair<uint128_t,bool>(w,false);
fNumberOfSlinkWords++;
fNumberOfEventWords++;
if(fArrayWrite==4) {
w.first=fArrayWord[1];
w.first=(w.first<<32)+fArrayWord[0];
w.second=fArrayWord[3];
w.second=(w.second<<32)+fArrayWord[2];
fSlinkWord[fNumberOfSlinkWords]=std::pair<uint128_t,bool>(w,false);
fNumberOfSlinkWords++;
fNumberOfEventWords++;
if(fPrintLevel>3) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "]::processBx() "
<< "Writing Slink data word = 0x" << std::hex << w.second << " " << w.first
<< std::dec << std::endl;
}
if(fPrintLevel>3) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "]::processBx() "
<< "Writing Slink data word = 0x" << std::hex << w.second << " " << w.first
<< std::dec << std::endl;
}
fArrayWrite=0;
for(unsigned i(0);i<4;i++) fArrayWord[i]=0;
fArrayWrite=0;
for(unsigned i(0);i<4;i++) fArrayWord[i]=0;
}
}
}
}
}
}
void processEconBx(unsigned ec, const uint32_t *d) {
bool exceededBuffer() const {
return fExceededBuffer;
}
void processEconBx(unsigned ec, const uint32_t *d) {
return;
return;
#ifdef NOT_YET
uint32_t a[7];
uint32_t a[7];
// Switch for different dataflow methods
// Switch for different dataflow methods
if(fDataFlowMethod==FixedHgcrocMap) {
if(fDataFlowMethod==FixedHgcrocMap) {
// 4 words per BX for 7 eLinks
unsigned nWords(4);
// 4 words per BX for 7 eLinks
unsigned nWords(4);
if(fPrintLevel>3) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Data flow method = fixed HGCROC map, reading "
<< nWords << " words per BX" << std::endl;
}
if(fPrintLevel>3) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Data flow method = fixed HGCROC map, reading "
<< nWords << " words per BX" << std::endl;
}
for(unsigned b(0);b<NumberOfParallelBuffers;b++) {
if(b!=(fActiveInputBuffer%NumberOfParallelBuffers)) {
for(unsigned b(0);b<NumberOfParallelBuffers;b++) {
if(b!=(fActiveInputBuffer%NumberOfParallelBuffers)) {
for(unsigned e(0);e<7;e++) {
if(fReadHgcroc[b]<fEconFile.fNumberOfHgcrocs) {
for(unsigned e(0);e<7;e++) {
if(fReadHgcroc[b]<fEconFile.fNumberOfHgcrocs) {
for(unsigned w(0);w<nWords;w++) {
assert(fReadHgcroc[b]<fEconFile.fNumberOfHgcrocs);
assert(fReadWord[b]<fFirstBuffer[b][fReadHgcroc[b]].size());
for(unsigned w(0);w<nWords;w++) {
assert(fReadHgcroc[b]<fEconFile.fNumberOfHgcrocs);
assert(fReadWord[b]<fFirstBuffer[b][fReadHgcroc[b]].size());
if(fPrintLevel>4) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Copying BX word " << w << " from first buffer " << b
<< ", HGCROC " << fReadHgcroc[b] << ", word " << fReadWord[b]
<< " of " << fFirstBuffer[b][fReadHgcroc[b]].size() << " = "
<< std::hex << fFirstBuffer[b][fReadHgcroc[b]][fReadWord[b]]
<< std::dec << std::endl;
if(fPrintLevel>4) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Copying BX word " << w << " from first buffer " << b
<< ", HGCROC " << fReadHgcroc[b] << ", word " << fReadWord[b]
<< " of " << fFirstBuffer[b][fReadHgcroc[b]].size() << " = "
<< std::hex << fFirstBuffer[b][fReadHgcroc[b]][fReadWord[b]]
<< std::dec << std::endl;
}
assert(fElink[fHgcrocToElink[h]].writeAndIncrementPtr(fFirstBuffer[b][fReadHgcrocNumber[b]][fReadWord[b]]));
}
assert(fElink[fHgcrocToElink[h]].writeAndIncrementPtr(fFirstBuffer[b][fReadHgcrocNumber[b]][fReadWord[b]]));
}
}
}
}
}
// Add zero padding word if odd
//if((nWords%2)==1) assert(fElink[fHgcrocToElink[h]].writeAndIncrementPtr(0));
// Add zero padding word if odd
//if((nWords%2)==1) assert(fElink[fHgcrocToElink[h]].writeAndIncrementPtr(0));
uint64_t d;
for(unsigned e(0);e<7;e++) {
if(fElink[e].readAndIncrementPtr(d)) a[e]=(d&0xffffffff);
else a[e]=0;
uint64_t d;
for(unsigned e(0);e<7;e++) {
if(fElink[e].readAndIncrementPtr(d)) a[e]=(d&0xffffffff);
else a[e]=0;
if(fPrintLevel>4) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Sending eLink " << e << " = "
<< std::hex << a[e]
<< std::dec << std::endl;
if(fPrintLevel>4) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Sending eLink " << e << " = "
<< std::hex << a[e]
<< std::dec << std::endl;
}
}
}
} else if(fDataFlowMethod==VariableHgcrocMap) {
} else if(fDataFlowMethod==VariableHgcrocMap) {
unsigned nWords(0);
unsigned nWords(0);
if(fPrintLevel>3) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Data flow method = variable HGCROC map, reading "
<< nWords << " words per BX" << std::endl;
}
if(fPrintLevel>3) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Data flow method = variable HGCROC map, reading "
<< nWords << " words per BX" << std::endl;
}
assert(false);
assert(false);
} else if(fDataFlowMethod==EventBuild) {
} else if(fDataFlowMethod==EventBuild) {
// 24 words per BX for 2 parallel buffers = 960 MHz
// 12 words per BX for 3 parallel buffers = 480 MHz
// 8 words per BX for 4 parallel buffers = 320 MHz
//unsigned nWords(24/(NumberOfParallelBuffers-1));
// 24 words per BX for 2 parallel buffers = 960 MHz
// 12 words per BX for 3 parallel buffers = 480 MHz
// 8 words per BX for 4 parallel buffers = 320 MHz
//unsigned nWords(24/(NumberOfParallelBuffers-1));
// For one block, must be > 55 words x 18 HGCROCs/44 BX = 22.5; also more than output = 7 words/BX
// OR
// For one block, must be > 39 words x 18 HGCROCs/44 BX = 15.95; also more than output = 7 words/BX
// For seven blocks, must be > 55 words x 3 HGCROCs/44 BX = 3.75; also more than output = 1 word/BX
// OR
// For seven blocks, must be > 39 words x 3 HGCROCs/44 BX = 2.66; also more than output = 1 word/BX
// For one block, must be > 55 words x 18 HGCROCs/44 BX = 22.5; also more than output = 7 words/BX
// OR
// For one block, must be > 39 words x 18 HGCROCs/44 BX = 15.95; also more than output = 7 words/BX
// For seven blocks, must be > 55 words x 3 HGCROCs/44 BX = 3.75; also more than output = 1 word/BX
// OR
// For seven blocks, must be > 39 words x 3 HGCROCs/44 BX = 2.66; also more than output = 1 word/BX
unsigned nWords(fEconArch.fNumberOfBlocks==1?24:4);
//unsigned nWords(fEconArch.fNumberOfBlocks==1?16:3);
unsigned nWords(fEconArch.fNumberOfBlocks==1?24:4);
//unsigned nWords(fEconArch.fNumberOfBlocks==1?16:3);
if(fPrintLevel>3) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Data flow method = event build, reading "
<< nWords << " words per BX" << std::endl;
}
if(fPrintLevel>3) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Data flow method = event build, reading "
<< nWords << " words per BX" << std::endl;
}
for(unsigned block(0);block<fEconArch.fNumberOfBlocks;block++) {
for(unsigned block(0);block<fEconArch.fNumberOfBlocks;block++) {
for(unsigned b(0);b<NumberOfParallelBuffers;b++) {
if(b!=(fActiveInputBuffer%NumberOfParallelBuffers)) {
for(unsigned b(0);b<NumberOfParallelBuffers;b++) {
if(b!=(fActiveInputBuffer%NumberOfParallelBuffers)) {
if(fPrintLevel>4) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Reading HGCROC number " << fReadHgcrocNumber[b][block]
<< " < " << fEconArch.fHgcrocNumber[block].size()
<< ", word number " << fReadWord[b][block] << std::endl;
}
if(fPrintLevel>4) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Reading HGCROC number " << fReadHgcrocNumber[b][block]
<< " < " << fEconArch.fHgcrocNumber[block].size()
<< ", word number " << fReadWord[b][block] << std::endl;
}
//if(fReadHgcrocNumber[b]<fEconFile.fNumberOfHgcrocs) {
if(fReadHgcrocNumber[b][block]<fEconArch.fHgcrocNumber[block].size()) {
//if(fReadHgcrocNumber[b]<fEconFile.fNumberOfHgcrocs) {
if(fReadHgcrocNumber[b][block]<fEconArch.fHgcrocNumber[block].size()) {
for(unsigned w(0);w<nWords;w++) {
//assert(fReadHgcroc[b]<fEconFile.fNumberOfHgcrocs);
for(unsigned w(0);w<nWords;w++) {
//assert(fReadHgcroc[b]<fEconFile.fNumberOfHgcrocs);
unsigned readHgcroc(fEconArch.fHgcrocNumber[block][fReadHgcrocNumber[b][block]]);
std::vector<uint32_t> &readBuffer(fFirstBuffer[b][readHgcroc]); // Convenient
assert(fReadWord[b][block]<readBuffer.size());
unsigned readHgcroc(fEconArch.fHgcrocNumber[block][fReadHgcrocNumber[b][block]]);
std::vector<uint32_t> &readBuffer(fFirstBuffer[b][readHgcroc]); // Convenient
assert(fReadWord[b][block]<readBuffer.size());
if(fPrintLevel>4) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Copying BX word " << w << " from block " << block << ", first buffer " << b
<< ", HGCROC " << readHgcroc << ", word " << fReadWord[b][block]
<< " of " << readBuffer.size() << " = "
<< std::hex << readBuffer[fReadWord[b][block]]
<< std::dec << std::endl;
}
// Write word to FIFO
if(fPrintLevel>4) {
std::cout << "BeSlinkSim[" << fSlinkArch->slinkNumber() << "][" << fEcon << "]::processBx() "
<< "Copying BX word " << w << " from block " << block << ", first buffer " << b
<< ", HGCROC " << readHgcroc << ", word " << fReadWord[b][block]
<< " of " << readBuffer.size() << " = "
<< std::hex << readBuffer[fReadWord[b][block]]
<< std::dec << std::endl;
}
// Write word to FIFO
assert(fEventBuffer[0][block].writeAndIncrementPtr(readBuffer[fReadWord[b][block]]));
assert(fEventBuffer[0][block].writeAndIncrementPtr(readBuffer[fReadWord[b][block]]));