conditional load testing (selected at compile time), turned on by default.
This commit is contained in:
parent
1ed2e27d19
commit
0b8aa00bc7
|
@ -83,10 +83,14 @@ bool DriveLoop::init()
|
||||||
scaleVector(*modBurst, txFullScale);
|
scaleVector(*modBurst, txFullScale);
|
||||||
for (int j = 0; j < 102; j++) {
|
for (int j = 0; j < 102; j++) {
|
||||||
for (int n = 0; n < mChanM; n++) {
|
for (int n = 0; n < mChanM; n++) {
|
||||||
|
#ifndef TRX_LOAD_TESTING
|
||||||
if (n == mC0)
|
if (n == mC0)
|
||||||
fillerTable[n][j][i] = new signalVector(*modBurst);
|
fillerTable[n][j][i] = new signalVector(*modBurst);
|
||||||
else
|
else
|
||||||
fillerTable[n][j][i] = new signalVector(modBurst->size());
|
fillerTable[n][j][i] = new signalVector(modBurst->size());
|
||||||
|
#else
|
||||||
|
fillerTable[n][j][i] = new signalVector(*modBurst);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete modBurst;
|
delete modBurst;
|
||||||
|
@ -129,7 +133,11 @@ void DriveLoop::pushRadioVector(GSM::Time &nowTime)
|
||||||
|
|
||||||
mTxBursts[i] = fillerTable[i][modFN][TN];
|
mTxBursts[i] = fillerTable[i][modFN][TN];
|
||||||
mIsFiller[i] = true;
|
mIsFiller[i] = true;
|
||||||
|
#ifndef TRX_LOAD_TESTING
|
||||||
mIsZero[i] = (mChanType[i][TN] == NONE);
|
mIsZero[i] = (mChanType[i][TN] == NONE);
|
||||||
|
#else
|
||||||
|
mIsZero[i] = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
// if queue contains data at the desired timestamp, stick it into FIFO
|
// if queue contains data at the desired timestamp, stick it into FIFO
|
||||||
if (next = (radioVector*) mTransmitPriorityQueue[i].getCurrentBurst(nowTime)) {
|
if (next = (radioVector*) mTransmitPriorityQueue[i].getCurrentBurst(nowTime)) {
|
||||||
|
|
|
@ -21,9 +21,10 @@
|
||||||
|
|
||||||
include $(top_srcdir)/Makefile.common
|
include $(top_srcdir)/Makefile.common
|
||||||
|
|
||||||
|
LOAD_TEST_FLAGS = -DTRX_LOAD_TESTING
|
||||||
AM_CFLAGS = $(STD_DEFINES_AND_INCLUDES) -std=gnu99 -march=native
|
AM_CFLAGS = $(STD_DEFINES_AND_INCLUDES) -std=gnu99 -march=native
|
||||||
AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES)
|
AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES)
|
||||||
AM_CXXFLAGS = -ldl -lpthread
|
AM_CXXFLAGS = -ldl -lpthread $(LOAD_TEST_FLAGS)
|
||||||
|
|
||||||
#UHD wins if both are defined
|
#UHD wins if both are defined
|
||||||
if UHD
|
if UHD
|
||||||
|
|
|
@ -60,7 +60,11 @@ Transceiver::Transceiver(int wBasePort, const char *TRXAddress,
|
||||||
mFIFOServiceLoopThread = NULL;
|
mFIFOServiceLoopThread = NULL;
|
||||||
mControlServiceLoopThread = NULL;
|
mControlServiceLoopThread = NULL;
|
||||||
mTransmitPriorityQueueServiceLoopThread = NULL;
|
mTransmitPriorityQueueServiceLoopThread = NULL;
|
||||||
|
#ifndef TRX_LOAD_TESTING
|
||||||
mMaxExpectedDelay = 0;
|
mMaxExpectedDelay = 0;
|
||||||
|
#else
|
||||||
|
mMaxExpectedDelay = 10;
|
||||||
|
#endif
|
||||||
|
|
||||||
mTransmitPriorityQueue = mDriveLoop->priorityQueue(mChannel);
|
mTransmitPriorityQueue = mDriveLoop->priorityQueue(mChannel);
|
||||||
mReceiveFIFO = mRadioInterface->receiveFIFO(mChannel);
|
mReceiveFIFO = mRadioInterface->receiveFIFO(mChannel);
|
||||||
|
@ -131,10 +135,12 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
|
||||||
|
|
||||||
DriveLoop::CorrType corrType = mDriveLoop->expectedCorrType(mChannel, rxBurst->getTime());
|
DriveLoop::CorrType corrType = mDriveLoop->expectedCorrType(mChannel, rxBurst->getTime());
|
||||||
|
|
||||||
|
#ifndef TRX_LOAD_TESTING
|
||||||
if ((corrType == DriveLoop::OFF) || (corrType == DriveLoop::IDLE)) {
|
if ((corrType == DriveLoop::OFF) || (corrType == DriveLoop::IDLE)) {
|
||||||
delete rxBurst;
|
delete rxBurst;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// check to see if received burst has sufficient
|
// check to see if received burst has sufficient
|
||||||
signalVector *vectorBurst = rxBurst;
|
signalVector *vectorBurst = rxBurst;
|
||||||
|
@ -152,8 +158,10 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
|
||||||
|
|
||||||
prevFalseDetectionTime = rxBurst->getTime();
|
prevFalseDetectionTime = rxBurst->getTime();
|
||||||
}
|
}
|
||||||
|
#ifndef TRX_LOAD_TESTING
|
||||||
delete rxBurst;
|
delete rxBurst;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
LOG(DEBUG) << "Estimated Energy: " << sqrt(avgPwr) << ", at time " << rxBurst->getTime();
|
LOG(DEBUG) << "Estimated Energy: " << sqrt(avgPwr) << ", at time " << rxBurst->getTime();
|
||||||
#endif
|
#endif
|
||||||
|
@ -186,6 +194,9 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
|
||||||
estimateChannel,
|
estimateChannel,
|
||||||
&channelResp,
|
&channelResp,
|
||||||
&chanOffset);
|
&chanOffset);
|
||||||
|
#ifdef TRX_LOAD_TESTING
|
||||||
|
success = true;
|
||||||
|
#endif
|
||||||
if (success) {
|
if (success) {
|
||||||
LOG(DEBUG) << "FOUND TSC!!!!!! " << amplitude << " " << TOA;
|
LOG(DEBUG) << "FOUND TSC!!!!!! " << amplitude << " " << TOA;
|
||||||
mEnergyThreshold -= 1.0F/10.0F;
|
mEnergyThreshold -= 1.0F/10.0F;
|
||||||
|
@ -217,6 +228,9 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
|
||||||
mSPS,
|
mSPS,
|
||||||
&litude,
|
&litude,
|
||||||
&TOA);
|
&TOA);
|
||||||
|
#ifdef TRX_LOAD_TESTING
|
||||||
|
success = true;
|
||||||
|
#endif
|
||||||
if (success) {
|
if (success) {
|
||||||
LOG(DEBUG) << "FOUND RACH!!!!!! " << amplitude << " " << TOA;
|
LOG(DEBUG) << "FOUND RACH!!!!!! " << amplitude << " " << TOA;
|
||||||
mEnergyThreshold -= (1.0F/10.0F);
|
mEnergyThreshold -= (1.0F/10.0F);
|
||||||
|
@ -396,7 +410,9 @@ void Transceiver::driveControl()
|
||||||
//set expected maximum time-of-arrival
|
//set expected maximum time-of-arrival
|
||||||
int maxDelay;
|
int maxDelay;
|
||||||
sscanf(buffer,"%3s %s %d",cmdcheck,command,&maxDelay);
|
sscanf(buffer,"%3s %s %d",cmdcheck,command,&maxDelay);
|
||||||
|
#ifndef TRX_LOAD_TESTING
|
||||||
mMaxExpectedDelay = maxDelay; // 1 GSM symbol is approx. 1 km
|
mMaxExpectedDelay = maxDelay; // 1 GSM symbol is approx. 1 km
|
||||||
|
#endif
|
||||||
sprintf(response,"RSP SETMAXDLY 0 %d",maxDelay);
|
sprintf(response,"RSP SETMAXDLY 0 %d",maxDelay);
|
||||||
}
|
}
|
||||||
else if (strcmp(command,"SETRXGAIN")==0) {
|
else if (strcmp(command,"SETRXGAIN")==0) {
|
||||||
|
|
|
@ -1143,18 +1143,25 @@ static int detectBurst(signalVector &burst,
|
||||||
/* Correlate */
|
/* Correlate */
|
||||||
if (!convolve(&burst, sync->sequence, &corr,
|
if (!convolve(&burst, sync->sequence, &corr,
|
||||||
CUSTOM, start, len, sps, 0)) {
|
CUSTOM, start, len, sps, 0)) {
|
||||||
|
#ifndef TRX_LOAD_TESTING
|
||||||
return -1;
|
return -1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Peak detection - place restrictions at correlation edges */
|
/* Peak detection - place restrictions at correlation edges */
|
||||||
*amp = fastPeakDetect(corr, toa);
|
*amp = fastPeakDetect(corr, toa);
|
||||||
|
|
||||||
|
#ifndef TRX_LOAD_TESTING
|
||||||
if ((*toa < 3 * sps) || (*toa > len - 3 * sps))
|
if ((*toa < 3 * sps) || (*toa > len - 3 * sps))
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Peak -to-average ratio */
|
/* Peak -to-average ratio */
|
||||||
if (computePeakRatio(&corr, sps, *toa, *amp) < thresh)
|
if (computePeakRatio(&corr, sps, *toa, *amp) < thresh) {
|
||||||
|
#ifndef TRX_LOAD_TESTING
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* Run the full peak detection when we have a burst */
|
/* Run the full peak detection when we have a burst */
|
||||||
*amp = peakDetect(corr, toa, NULL);
|
*amp = peakDetect(corr, toa, NULL);
|
||||||
|
|
Loading…
Reference in New Issue