Skip to content
Snippets Groups Projects
Commit eda405d1 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #3696: Added tSampleBuffer

parent 1e227f4d
Branches
Tags
No related merge requests found
...@@ -3653,6 +3653,7 @@ RTCP/InputProc/test/CMakeLists.txt -text ...@@ -3653,6 +3653,7 @@ RTCP/InputProc/test/CMakeLists.txt -text
RTCP/InputProc/test/tGenerator.cc -text RTCP/InputProc/test/tGenerator.cc -text
RTCP/InputProc/test/tRSPTimeStamp2.cc -text RTCP/InputProc/test/tRSPTimeStamp2.cc -text
RTCP/InputProc/test/tRanges.cc -text RTCP/InputProc/test/tRanges.cc -text
RTCP/InputProc/test/tSampleBuffer.cc -text
RTCP/InputProc/test/tSharedMemory.cc -text RTCP/InputProc/test/tSharedMemory.cc -text
RTCP/Interface/include/Interface/BGPAsm.h -text RTCP/Interface/include/Interface/BGPAsm.h -text
RTCP/Interface/include/Interface/BeamCoordinates.h -text RTCP/Interface/include/Interface/BeamCoordinates.h -text
......
...@@ -8,4 +8,5 @@ include_directories(${PACKAGE_SOURCE_DIR}/src) ...@@ -8,4 +8,5 @@ include_directories(${PACKAGE_SOURCE_DIR}/src)
lofar_add_test(tGenerator tGenerator.cc) lofar_add_test(tGenerator tGenerator.cc)
lofar_add_test(tRSPTimeStamp2 tRSPTimeStamp2.cc) lofar_add_test(tRSPTimeStamp2 tRSPTimeStamp2.cc)
lofar_add_test(tRanges tRanges.cc) lofar_add_test(tRanges tRanges.cc)
lofar_add_test(tSampleBuffer tSampleBuffer.cc)
lofar_add_test(tSharedMemory tSharedMemory.cc) lofar_add_test(tSharedMemory tSharedMemory.cc)
#include <lofar_config.h>
#include "SampleBuffer.h"
#include "SampleType.h"
#include "OMPThread.h"
#include <Common/LofarLogger.h>
#include <vector>
#include <string>
#include "omp.h"
using namespace LOFAR;
using namespace RTCP;
using namespace std;
// Duration of the test (seconds)
#define DURATION 2
// The number of packets to transmit (note: there are 16 time samples/packet)
#define NUMPACKETS (200000000/1024/16)
template<typename T> void test( struct BufferSettings &settings )
{
SampleBuffer< SampleType<T> > buffer_create(settings, true);
SampleBuffer< SampleType<T> > buffer_read(settings, false);
}
int main( int, char **argv ) {
INIT_LOGGER( argv[0] );
// Don't run forever if communication fails for some reason
alarm(10);
omp_set_nested(true);
omp_set_num_threads(16);
OMPThread::init();
unsigned clock = 200 * 1000 * 1000;
struct StationID stationID("RS106", "LBA", clock, 16);
struct BufferSettings settings;
settings.station = stationID;
settings.nrBeamlets = 61;
settings.nrBoards = 1;
settings.nrSamples = (2 * stationID.clock / 1024);// & ~0xFL;
settings.nrFlagRanges = 64;
settings.dataKey = 0x12345678;
LOG_INFO("Test 16-bit complex");
test<i16complex>(settings);
LOG_INFO("Test 8-bit complex");
test<i8complex>(settings);
LOG_INFO("Test 4-bit complex");
test<i4complex>(settings);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment