conditional load testing (selected at compile time), turned on by default.

This commit is contained in:
Alexander Chemeris 2013-09-06 00:35:57 +04:00
parent 1ed2e27d19
commit 0b8aa00bc7
4 changed files with 35 additions and 3 deletions

View File

@ -83,10 +83,14 @@ bool DriveLoop::init()
scaleVector(*modBurst, txFullScale);
for (int j = 0; j < 102; j++) {
for (int n = 0; n < mChanM; n++) {
#ifndef TRX_LOAD_TESTING
if (n == mC0)
fillerTable[n][j][i] = new signalVector(*modBurst);
else
fillerTable[n][j][i] = new signalVector(modBurst->size());
#else
fillerTable[n][j][i] = new signalVector(*modBurst);
#endif
}
}
delete modBurst;
@ -129,7 +133,11 @@ void DriveLoop::pushRadioVector(GSM::Time &nowTime)
mTxBursts[i] = fillerTable[i][modFN][TN];
mIsFiller[i] = true;
#ifndef TRX_LOAD_TESTING
mIsZero[i] = (mChanType[i][TN] == NONE);
#else
mIsZero[i] = false;
#endif
// if queue contains data at the desired timestamp, stick it into FIFO
if (next = (radioVector*) mTransmitPriorityQueue[i].getCurrentBurst(nowTime)) {

View File

@ -21,9 +21,10 @@
include $(top_srcdir)/Makefile.common
LOAD_TEST_FLAGS = -DTRX_LOAD_TESTING
AM_CFLAGS = $(STD_DEFINES_AND_INCLUDES) -std=gnu99 -march=native
AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES)
AM_CXXFLAGS = -ldl -lpthread
AM_CXXFLAGS = -ldl -lpthread $(LOAD_TEST_FLAGS)
#UHD wins if both are defined
if UHD

View File

@ -60,7 +60,11 @@ Transceiver::Transceiver(int wBasePort, const char *TRXAddress,
mFIFOServiceLoopThread = NULL;
mControlServiceLoopThread = NULL;
mTransmitPriorityQueueServiceLoopThread = NULL;
#ifndef TRX_LOAD_TESTING
mMaxExpectedDelay = 0;
#else
mMaxExpectedDelay = 10;
#endif
mTransmitPriorityQueue = mDriveLoop->priorityQueue(mChannel);
mReceiveFIFO = mRadioInterface->receiveFIFO(mChannel);
@ -131,11 +135,13 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
DriveLoop::CorrType corrType = mDriveLoop->expectedCorrType(mChannel, rxBurst->getTime());
#ifndef TRX_LOAD_TESTING
if ((corrType == DriveLoop::OFF) || (corrType == DriveLoop::IDLE)) {
delete rxBurst;
return NULL;
}
#endif
// check to see if received burst has sufficient
signalVector *vectorBurst = rxBurst;
complex amplitude = 0.0;
@ -152,8 +158,10 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
prevFalseDetectionTime = rxBurst->getTime();
}
#ifndef TRX_LOAD_TESTING
delete rxBurst;
return NULL;
#endif
}
LOG(DEBUG) << "Estimated Energy: " << sqrt(avgPwr) << ", at time " << rxBurst->getTime();
#endif
@ -186,6 +194,9 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
estimateChannel,
&channelResp,
&chanOffset);
#ifdef TRX_LOAD_TESTING
success = true;
#endif
if (success) {
LOG(DEBUG) << "FOUND TSC!!!!!! " << amplitude << " " << TOA;
mEnergyThreshold -= 1.0F/10.0F;
@ -217,6 +228,9 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
mSPS,
&amplitude,
&TOA);
#ifdef TRX_LOAD_TESTING
success = true;
#endif
if (success) {
LOG(DEBUG) << "FOUND RACH!!!!!! " << amplitude << " " << TOA;
mEnergyThreshold -= (1.0F/10.0F);
@ -396,7 +410,9 @@ void Transceiver::driveControl()
//set expected maximum time-of-arrival
int maxDelay;
sscanf(buffer,"%3s %s %d",cmdcheck,command,&maxDelay);
#ifndef TRX_LOAD_TESTING
mMaxExpectedDelay = maxDelay; // 1 GSM symbol is approx. 1 km
#endif
sprintf(response,"RSP SETMAXDLY 0 %d",maxDelay);
}
else if (strcmp(command,"SETRXGAIN")==0) {

View File

@ -1143,18 +1143,25 @@ static int detectBurst(signalVector &burst,
/* Correlate */
if (!convolve(&burst, sync->sequence, &corr,
CUSTOM, start, len, sps, 0)) {
#ifndef TRX_LOAD_TESTING
return -1;
#endif
}
/* Peak detection - place restrictions at correlation edges */
*amp = fastPeakDetect(corr, toa);
#ifndef TRX_LOAD_TESTING
if ((*toa < 3 * sps) || (*toa > len - 3 * sps))
return 0;
#endif
/* Peak -to-average ratio */
if (computePeakRatio(&corr, sps, *toa, *amp) < thresh)
if (computePeakRatio(&corr, sps, *toa, *amp) < thresh) {
#ifndef TRX_LOAD_TESTING
return 0;
#endif
}
/* Run the full peak detection when we have a burst */
*amp = peakDetect(corr, toa, NULL);