Skip to content
Snippets Groups Projects
Commit 081ccb5f authored by Kenneth Hiemstra's avatar Kenneth Hiemstra
Browse files

extra

parent 157e3c6b
No related branches found
No related tags found
No related merge requests found
...@@ -96,10 +96,14 @@ def test_BG_to_DB(tc,io,cmd,use_pps=False): ...@@ -96,10 +96,14 @@ def test_BG_to_DB(tc,io,cmd,use_pps=False):
Bg = pi_diag_block_gen.PiDiagBlockGen(tc,io,nofChannels=nof_streams, ramSizePerChannel=blocksize) Bg = pi_diag_block_gen.PiDiagBlockGen(tc,io,nofChannels=nof_streams, ramSizePerChannel=blocksize)
#Bg.write_block_gen_settings(samplesPerPacket=700, blocksPerSync=781250, gapSize=300, memLowAddr=0, memHighAddr=701, BSNInit=42) #Bg.write_block_gen_settings(samplesPerPacket=700, blocksPerSync=781250, gapSize=300, memLowAddr=0, memHighAddr=701, BSNInit=42)
Db = pi_diag_data_buffer.PiDiagDataBuffer(tc,io,nofStreams=nof_streams,ramSizePerStream=blocksize) Db = pi_diag_data_buffer.PiDiagDataBuffer(tc,io,nofStreams=nof_streams,ramSizePerStream=blocksize)
resetptrn = [0xffffffff]*samples_per_packet + [0]*(blocksize-samples_per_packet) resetptrn = [0xc1ea1ed1]*blocksize #samples_per_packet + [0]*(blocksize-samples_per_packet)
for s in tc.spNrs: for s in tc.spNrs:
Db.overwrite_data_buffer(resetptrn,streamNr=s,vLevel=9) Db.overwrite_data_buffer(resetptrn,streamNr=s,vLevel=9)
db_ram = []
for s in tc.spNrs:
db_ram.append(Db.read_data_buffer(streamNr=s,vLevel=5))
if use_pps==True: if use_pps==True:
Bg.write_enable_pps() Bg.write_enable_pps()
ppsh.wait_until_pps(vLevel=6) ppsh.wait_until_pps(vLevel=6)
...@@ -114,10 +118,22 @@ def test_BG_to_DB(tc,io,cmd,use_pps=False): ...@@ -114,10 +118,22 @@ def test_BG_to_DB(tc,io,cmd,use_pps=False):
for r in ram: rram.append(list(r)) # () -> [] for r in ram: rram.append(list(r)) # () -> []
bg_ram.append(rram) bg_ram.append(rram)
db_ram = [] db_ram = []
for s in tc.spNrs: for s in tc.spNrs:
db_ram.append(Db.read_data_buffer(streamNr=s,vLevel=5)) db_ram.append(Db.read_data_buffer(streamNr=s,vLevel=5))
# truncate: in 10GbE the data is only sized 700
for s in tc.spNrs:
bg_ram[s][0] = bg_ram[s][0][:-(blocksize-700)]
db_ram[s][0] = db_ram[s][0][:-(blocksize-700)]
#bg_ram[s][0] = bg_ram[s][0][:-(blocksize-samples_per_packet)]
#db_ram[s][0] = db_ram[s][0][:-(blocksize-samples_per_packet)]
#print 'bg_ram=',bg_ram
#print 'db_ram=',db_ram
tc.set_section_id('Compare (BG==DB) - ') tc.set_section_id('Compare (BG==DB) - ')
compared = (bg_ram == db_ram) compared = (bg_ram == db_ram)
tc.append_log(3, '') tc.append_log(3, '')
...@@ -175,8 +191,7 @@ def test_info(tc,io,cmd): ...@@ -175,8 +191,7 @@ def test_info(tc,io,cmd):
tc.append_log(3, '>>>') tc.append_log(3, '>>>')
#with node_io.NodeIO(tc.nodeImages, tc.base_ip) as temp_io: #with node_io.NodeIO(tc.nodeImages, tc.base_ip) as temp_io:
temp_io = node_io.NodeIO(tc.nodeImages, tc.base_ip) info = pi_system_info.PiSystemInfo(tc, io)
info = pi_system_info.PiSystemInfo(tc, temp_io)
tc.append_log(1, '>>> reading REGMAPs') tc.append_log(1, '>>> reading REGMAPs')
info.make_register_info() info.make_register_info()
tc.append_log(3, '') tc.append_log(3, '')
...@@ -253,11 +268,10 @@ def test_remu(tc,io,cmd): ...@@ -253,11 +268,10 @@ def test_remu(tc,io,cmd):
tc.append_log(3, '>>>') tc.append_log(3, '>>>')
dummy_tc = test_case.Testcase('Dummy TB - ', '') dummy_tc = test_case.Testcase('Dummy TB - ', '')
#with node_io.NodeIO(tc.nodeImages, tc.base_ip) as temp_io:
temp_io = node_io.NodeIO(tc.nodeImages, tc.base_ip)
dummy_tc.set_result('PASSED') dummy_tc.set_result('PASSED')
Remu = pi_remu.PiRemu(dummy_tc, temp_io) #with pi_remu.PiRemu(dummy_tc, io) as Remu:
Remu = pi_remu.PiRemu(dummy_tc, io)
try: try:
Remu.write_user_reconfigure() Remu.write_user_reconfigure()
except: except:
...@@ -266,7 +280,6 @@ def test_remu(tc,io,cmd): ...@@ -266,7 +280,6 @@ def test_remu(tc,io,cmd):
if dummy_tc.get_result() == 'FAILED': if dummy_tc.get_result() == 'FAILED':
tc.append_log(1, 'Result=%s but ignoring this' % dummy_tc.get_result()) tc.append_log(1, 'Result=%s but ignoring this' % dummy_tc.get_result())
del dummy_tc
tc.append_log(3, '') tc.append_log(3, '')
...@@ -382,7 +395,7 @@ tc.append_log(3, '>>>') ...@@ -382,7 +395,7 @@ tc.append_log(3, '>>>')
# Create access object for nodes # Create access object for nodes
io = node_io.NodeIO(tc.nodeImages, tc.base_ip) #io = node_io.NodeIO(tc.nodeImages, tc.base_ip)
...@@ -398,7 +411,8 @@ while rep < tc.repeat: ...@@ -398,7 +411,8 @@ while rep < tc.repeat:
if cmd > len(Cmd): cmd = 100 # default to help_text if cmd > len(Cmd): cmd = 100 # default to help_text
tc.append_log(3, 'Next command: %d : %s: %s' % (cmd,Cmd[cmd][0],Cmd[cmd][2])) tc.append_log(3, 'Next command: %d : %s: %s' % (cmd,Cmd[cmd][0],Cmd[cmd][2]))
Cmd[cmd][1](tc,io,cmd) with node_io.NodeIO(tc.nodeImages, tc.base_ip) as temp_io:
Cmd[cmd][1](tc,temp_io,cmd)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment