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

cleaned up

parent 85920fe5
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,6 @@ Description:
###############################################################################
# System imports
import sys
import numpy as np
import test_case
import node_io
import pi_system_info
......@@ -70,36 +69,47 @@ from pi_common import *
def test_bg(tc, io):
tc.set_section_id('Read BG - ')
tc.set_section_id('Test BG - ')
tc.append_log(3, '>>>')
tc.append_log(1, '>>> Access the peripheral (pi_diag_block_gen.py)')
tc.append_log(1, '>>> Access the peripherals BG (pi_diag_block_gen.py) and DB (pi_diag_data_buffer.py)')
tc.append_log(3, '>>>')
ppsh = pi_ppsh.PiPpsh(tc, io)
tc.set_section_id('Read - ')
nof_streams=3
Bg = pi_diag_block_gen.PiDiagBlockGen(tc,io,nofChannels=nof_streams,ramSizePerChannel=1000)
#Bg.write_disable()
Bg.write_disable()
settings = Bg.read_block_gen_settings()
samples_per_packet = settings[0][1]
Bg = pi_diag_block_gen.PiDiagBlockGen(tc,io,nofChannels=nof_streams, ramSizePerChannel=samples_per_packet)
#Bg.write_enable() # or Bg.write_enable_pps()
Bg.write_enable() # or Bg.write_enable_pps()
ppsh.wait_until_pps(vLevel=6)
bg_ram = []
for s in range(nof_streams):
bg_ram.append(Bg.read_waveform_ram(channelNr=s,vLevel=5))
print 'bg_ram=',np.asarray(bg_ram)
ram = Bg.read_waveform_ram(channelNr=s,vLevel=5)
lram=[]
for r in ram: lram.append(list(r)) # () -> []
bg_ram.append(lram)
#print 'bg_ram=',bg_ram
#bg_ram[0][0]=0
Db = pi_diag_data_buffer.PiDiagDataBuffer(tc,io,nofStreams=nof_streams,ramSizePerStream=samples_per_packet)
db_ram = []
for s in range(nof_streams):
db_ram.append(Db.read_data_buffer(streamNr=s,vLevel=5))
print 'db_ram=',np.asarray(db_ram)
#print 'db_ram=',db_ram
print 'compare=',not False in (np.asarray(bg_ram)==np.asarray(db_ram))
tc.set_section_id('Compare (BG==DB) - ')
compared = (bg_ram == db_ram)
tc.append_log(3, '')
tc.append_log(1, '>>> (BG==DB): %s' % compared)
tc.append_log(3, '')
if compared==False: tc.set_result('FAILED')
def test_tr_xaui(tc, io):
tc.set_section_id('Read tr xaui status - ')
......
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