Skip to content
Snippets Groups Projects
Commit b852669b authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Added verify ID marker = 65 and ID version = 2.

parent db4b369e
Branches
Tags
No related merge requests found
...@@ -69,6 +69,7 @@ c_dbSize = 1024 ...@@ -69,6 +69,7 @@ c_dbSize = 1024
c_dbPattern = [13]*c_dbSize c_dbPattern = [13]*c_dbSize
c_baseSrcMac = 0x002286080000 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 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: if c_wcudata==1:
c_baseDstMacEth01 = 0xe41d2de42690 c_baseDstMacEth01 = 0xe41d2de42690
...@@ -77,6 +78,9 @@ else: ...@@ -77,6 +78,9 @@ else:
c_baseDstMacEth01 = 0xe41d2dbc3dc0 c_baseDstMacEth01 = 0xe41d2dbc3dc0
c_baseDstMacEth23 = 0xe41d2de40d30 c_baseDstMacEth23 = 0xe41d2de40d30
c_expIdMarker = 65
c_expIdVersion = 2
wsrtTelescopes = ['2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd'] wsrtTelescopes = ['2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd']
############################################################################### ###############################################################################
...@@ -156,6 +160,15 @@ for bui in beamlets: ...@@ -156,6 +160,15 @@ for bui in beamlets:
############################################################################### ###############################################################################
# Verification per PN # Verification per PN
for ni,nr in enumerate(tc.nodeNrs): # loop 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): # Beamlet mapping as specified in SP-062 table 6 (SC1), 9 (SC4):
# #
# u bi dest bu_i # u bi dest bu_i
...@@ -179,16 +192,13 @@ for bui in beamlets: ...@@ -179,16 +192,13 @@ for bui in beamlets:
# 1 1 5 BN1 513 515 ... # 1 1 5 BN1 513 515 ...
# 2 1 6 BN2 768 770 ... # 2 1 6 BN2 768 770 ...
# 3 1 7 BN3 769 771 ... # 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 = N_slot * unb # offset for UniBoard band
expBeamlet = expBeamlet + N_clk * (pn / Q_interleave) + (pn % Q_interleave) # offset for Local PN expBeamlet = expBeamlet + N_clk * (pn / Q_interleave) + (pn % Q_interleave) # offset for Local PN
expBeamlet = expBeamlet + bui * Q_interleave # offset serial beamlets expBeamlet = expBeamlet + bui * Q_interleave # offset serial beamlets
expChannel = cm.reverse_bits(ch, N_chan_x_w) expChannel = cm.reverse_bits(ch, N_chan_x_w)
expChannel = cm.invert_msbit(expChannel, 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) # 0 gap(16) + ETH dst mac hi(16)
# 1 ETH dst mac lo # 1 ETH dst mac lo
# 2 ETH src mac hi # 2 ETH src mac hi
...@@ -211,9 +221,6 @@ for bui in beamlets: ...@@ -211,9 +221,6 @@ for bui in beamlets:
# 19 FLAG # 19 FLAG
# 20 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 # . dst mac as defined in central_commands.sh
if unb< 4: expDstMac = c_baseDstMacEth01 if unb< 4: expDstMac = c_baseDstMacEth01
elif unb< 8: expDstMac = c_baseDstMacEth01 + 1 elif unb< 8: expDstMac = c_baseDstMacEth01 + 1
...@@ -238,6 +245,22 @@ for bui in beamlets: ...@@ -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.append_log(tc.V_ERRORS, reportStr + 'read source MAC is wrong (read 0x%012X != 0x%012X expected)' % (rdSrcMac, expSrcMac))
tc.set_result('FAILED') 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 # . beamlet
rdBeamlet = cm.to_unsigned(rdData[11], 16) rdBeamlet = cm.to_unsigned(rdData[11], 16)
if rdBeamlet == expBeamlet: if rdBeamlet == expBeamlet:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment