diff --git a/applications/apertif/commissioning/tests/verify_correlator_db_output.py b/applications/apertif/commissioning/tests/verify_correlator_db_output.py index 5a0184967616c7dc910480a0ebbebcaeb21e6ca5..3d23a00d570a4bf897ed9fa66ccc1c7dec9f0799 100644 --- a/applications/apertif/commissioning/tests/verify_correlator_db_output.py +++ b/applications/apertif/commissioning/tests/verify_correlator_db_output.py @@ -69,6 +69,7 @@ c_dbSize = 1024 c_dbPattern = [13]*c_dbSize c_baseSrcMac = 0x002286080000 + c_wcudata = 1 # is 1 if Data Write is 'wcudata1', else is 2 if DataWriter is 'wcudata2', as defined in central_commands.sh if c_wcudata==1: c_baseDstMacEth01 = 0xe41d2de42690 @@ -77,6 +78,9 @@ else: c_baseDstMacEth01 = 0xe41d2dbc3dc0 c_baseDstMacEth23 = 0xe41d2de40d30 +c_expIdMarker = 65 +c_expIdVersion = 2 + wsrtTelescopes = ['2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd'] ############################################################################### @@ -156,6 +160,15 @@ for bui in beamlets: ############################################################################### # Verification per PN for ni,nr in enumerate(tc.nodeNrs): # loop PN + # Get read packet data + reportStr = 'unb = %2d, pn = %d, bui = %3d, ch = %2d : ' % (unb, pn, bui, ch) + rdData = dbOutputReadData[ni] + + ################################################################### + # Verify header fields + unb = nr / nof_pn # = range(N_band) = 0:15 = [0:127] / 8 + pn = nr % nof_pn # = range(nof_pn) = 0:7 = [0:127] % 8 + # Beamlet mapping as specified in SP-062 table 6 (SC1), 9 (SC4): # # u bi dest bu_i @@ -179,16 +192,13 @@ for bui in beamlets: # 1 1 5 BN1 513 515 ... # 2 1 6 BN2 768 770 ... # 3 1 7 BN3 769 771 ... - unb = nr / nof_pn # = range(N_band) = 0:15 = [0:127] / 8 - pn = nr % nof_pn # = range(nof_pn) = 0:7 = [0:127] % 8 - expBeamlet = N_slot * unb # offset for UniBoard band expBeamlet = expBeamlet + N_clk * (pn / Q_interleave) + (pn % Q_interleave) # offset for Local PN expBeamlet = expBeamlet + bui * Q_interleave # offset serial beamlets expChannel = cm.reverse_bits(ch, N_chan_x_w) expChannel = cm.invert_msbit(expChannel, N_chan_x_w) - # Verify header fields + # Header fields # 0 gap(16) + ETH dst mac hi(16) # 1 ETH dst mac lo # 2 ETH src mac hi @@ -211,9 +221,6 @@ for bui in beamlets: # 19 FLAG # 20 FLAG - rdData = dbOutputReadData[ni] - reportStr = 'unb = %2d, pn = %d, bui = %3d, ch = %2d : ' % (unb, pn, bui, ch) - # . dst mac as defined in central_commands.sh if unb< 4: expDstMac = c_baseDstMacEth01 elif unb< 8: expDstMac = c_baseDstMacEth01 + 1 @@ -238,6 +245,22 @@ for bui in beamlets: tc.append_log(tc.V_ERRORS, reportStr + 'read source MAC is wrong (read 0x%012X != 0x%012X expected)' % (rdSrcMac, expSrcMac)) tc.set_result('FAILED') + # . ID marker + rdIdMarker = cm.to_unsigned(rdData[11], 32) >> 24 + if rdIdMarker == c_expIdMarker: + tc.append_log(tc.V_INFO_DETAILS, reportStr + 'ID marker = %d is OK' % rdIdMarker) + else: + tc.append_log(tc.V_ERRORS, reportStr + 'read ID marker is wrong (read %d != %d expected)' % (rdIdMarker, c_expIdMarker)) + tc.set_result('FAILED') + + # . ID version + rdIdVersion = cm.to_unsigned(rdData[11], 24) >> 16 + if rdIdVersion == c_expIdVersion: + tc.append_log(tc.V_INFO_DETAILS, reportStr + 'ID version = %d is OK' % rdIdVersion) + else: + tc.append_log(tc.V_ERRORS, reportStr + 'read ID version is wrong (read %d != %d expected)' % (rdIdVersion, c_expIdVersion)) + tc.set_result('FAILED') + # . beamlet rdBeamlet = cm.to_unsigned(rdData[11], 16) if rdBeamlet == expBeamlet: