diff --git a/Appl/CEP/CS1/CS1_BGLProc/src/Correlator.S b/Appl/CEP/CS1/CS1_BGLProc/src/Correlator.S index 8247eb1f43daf5d140867186c61aa6f8e79e2f34..a1940ca0192014a548e35a71f5388b7c31382764 100644 --- a/Appl/CEP/CS1/CS1_BGLProc/src/Correlator.S +++ b/Appl/CEP/CS1/CS1_BGLProc/src/Correlator.S @@ -28,6 +28,15 @@ # fxcpnsma 1,16,21,1 # f1r += f21r*f16r, f1i -= f21i*f16r # fxcxma 1,16,21,1 # f1r += f21i*f16i, f1i += f21r*f16i + +.global _correlator_constants_used +_correlator_constants_used: + .long NR_STATIONS + .long NR_SAMPLES_PER_INTEGRATION + .long NR_SUBBAND_CHANNELS + .long NR_POLARIZATIONS + + .align 5 zero: .long 0,0 diff --git a/Appl/CEP/CS1/CS1_BGLProc/src/Correlator.h b/Appl/CEP/CS1/CS1_BGLProc/src/Correlator.h index 5eaa5863fe420653c1371670ea650238c4d42552..433c5aabc47f9d94aed3a1cf7bf09e4883d2ed00 100644 --- a/Appl/CEP/CS1/CS1_BGLProc/src/Correlator.h +++ b/Appl/CEP/CS1/CS1_BGLProc/src/Correlator.h @@ -78,6 +78,13 @@ extern "C" { DH_Visibilities::AllNrValidSamplesType *nrValidSamplesCounted, const float correlationWeights[NR_SAMPLES_PER_INTEGRATION + 1], const float thresholds[NR_BASELINES][NR_SUBBAND_CHANNELS]); + + struct { + unsigned nr_stations; + unsigned nr_samples_per_integration; + unsigned nr_subband_channels; + unsigned nr_polarizations; + } _correlator_constants_used; }; } diff --git a/Appl/CEP/CS1/CS1_BGLProc/src/FIR.S b/Appl/CEP/CS1/CS1_BGLProc/src/FIR.S index 812684d22f7ed1785ec5ca1901820629134a8ee9..48f53e02ac7daa9c5a757881246dabb86267b311 100644 --- a/Appl/CEP/CS1/CS1_BGLProc/src/FIR.S +++ b/Appl/CEP/CS1/CS1_BGLProc/src/FIR.S @@ -26,6 +26,14 @@ #define FCOMPLEX_SIZE 8 #define DCOMPLEX_SIZE 16 +.global _FIR_constants_used +_FIR_constants_used: + .long INPUT_TYPE + .long NR_STATIONS + .long NR_SAMPLES_PER_INTEGRATION + .long NR_SUBBAND_CHANNELS + .long NR_POLARIZATIONS + .align 5 .global _bgl_mutex_lock diff --git a/Appl/CEP/CS1/CS1_BGLProc/src/FIR.h b/Appl/CEP/CS1/CS1_BGLProc/src/FIR.h index 42656c2806cb2adba37ea83b3c9889590df0bd45..12640c2dba05fe55903b23c462db8abd30beb687 100644 --- a/Appl/CEP/CS1/CS1_BGLProc/src/FIR.h +++ b/Appl/CEP/CS1/CS1_BGLProc/src/FIR.h @@ -64,6 +64,14 @@ extern "C" { void _memzero(void *dst, size_t bytes); // bytes must be multiple of 128 void _prefetch(const void *src, size_t count, size_t stride); + struct { + unsigned input_type; + unsigned nr_stations; + unsigned nr_samples_per_integration; + unsigned nr_subband_channels; + unsigned nr_polarizations; + } _FIR_constants_used; + void _bgl_mutex_lock(BGL_Mutex *), _bgl_mutex_unlock(BGL_Mutex *); unsigned long long _rdtsc(); }; diff --git a/Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.cc b/Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.cc index 8f5679dd317df9f590497ff494a100f24ae6699a..e2166636455a94c2450c18308b6e5d8db301d7f9 100644 --- a/Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.cc +++ b/Appl/CEP/CS1/CS1_BGLProc/src/WH_BGL_Processing.cc @@ -1194,6 +1194,17 @@ void WH_BGL_Processing::preprocess() } #if defined HAVE_BGL && !defined C_IMPLEMENTATION + ASSERT(_FIR_constants_used.input_type == INPUT_TYPE); + ASSERT(_FIR_constants_used.nr_stations == NR_STATIONS); + ASSERT(_FIR_constants_used.nr_samples_per_integration == NR_SAMPLES_PER_INTEGRATION); + ASSERT(_FIR_constants_used.nr_subband_channels == NR_SUBBAND_CHANNELS); + ASSERT(_FIR_constants_used.nr_polarizations == NR_POLARIZATIONS); + + ASSERT(_correlator_constants_used.nr_stations == NR_STATIONS); + ASSERT(_correlator_constants_used.nr_samples_per_integration == NR_SAMPLES_PER_INTEGRATION); + ASSERT(_correlator_constants_used.nr_subband_channels == NR_SUBBAND_CHANNELS); + ASSERT(_correlator_constants_used.nr_polarizations == NR_POLARIZATIONS); + mutex = rts_allocate_mutex(); #endif } @@ -1212,7 +1223,6 @@ void WH_BGL_Processing::computeFlags() computeFlagsTimer.start(); -#if 1 || defined C_IMPLEMENTATION memset(flags, 0, sizeof flags); for (int stat = 0; stat < NR_STATIONS; stat ++) { @@ -1234,9 +1244,6 @@ void WH_BGL_Processing::computeFlags() } } } -#else - _compute_flags(input, &flags); // broken -#endif #endif for (int stat2 = 0; stat2 < NR_STATIONS; stat2 ++) {