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

added bg - db tests on loopback

parent cae849ac
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,7 @@ Description: ...@@ -48,6 +48,7 @@ Description:
############################################################################### ###############################################################################
# System imports # System imports
import sys import sys
import numpy as np
import test_case import test_case
import node_io import node_io
import pi_system_info import pi_system_info
...@@ -58,6 +59,8 @@ import pi_epcs ...@@ -58,6 +59,8 @@ import pi_epcs
import pi_remu import pi_remu
import pi_eth import pi_eth
import pi_bsn_monitor import pi_bsn_monitor
import pi_diag_block_gen
import pi_diag_data_buffer
from tools import * from tools import *
from common import * from common import *
...@@ -66,6 +69,38 @@ from pi_common import * ...@@ -66,6 +69,38 @@ from pi_common import *
def test_bg(tc, io):
tc.set_section_id('Read BG - ')
tc.append_log(3, '>>>')
tc.append_log(1, '>>> Access the peripheral (pi_diag_block_gen.py)')
tc.append_log(3, '>>>')
ppsh = pi_ppsh.PiPpsh(tc, io)
nof_streams=3
Bg = pi_diag_block_gen.PiDiagBlockGen(tc,io,nofChannels=nof_streams,ramSizePerChannel=1000)
#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()
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)
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 'compare=',not False in (np.asarray(bg_ram)==np.asarray(db_ram))
tc.append_log(3, '')
def test_tr_xaui(tc, io): def test_tr_xaui(tc, io):
tc.set_section_id('Read tr xaui status - ') tc.set_section_id('Read tr xaui status - ')
tc.append_log(3, '>>>') tc.append_log(3, '>>>')
...@@ -73,7 +108,7 @@ def test_tr_xaui(tc, io): ...@@ -73,7 +108,7 @@ def test_tr_xaui(tc, io):
tc.append_log(3, '>>>') tc.append_log(3, '>>>')
tc.append_log(3, '') tc.append_log(3, '')
from pi_tr_xaui import * from pi_tr_xaui import REGMAP,PiTrXaui
on_execute(class_definition=PiTrXaui,regmap=REGMAP) on_execute(class_definition=PiTrXaui,regmap=REGMAP)
def test_tr_10GbE(tc, io): def test_tr_10GbE(tc, io):
...@@ -83,7 +118,7 @@ def test_tr_10GbE(tc, io): ...@@ -83,7 +118,7 @@ def test_tr_10GbE(tc, io):
tc.append_log(3, '>>>') tc.append_log(3, '>>>')
tc.append_log(3, '') tc.append_log(3, '')
from pi_tr_10GbE import * from pi_tr_10GbE import REGMAP,PiTr10GbE
on_execute(class_definition=PiTr10GbE,regmap=REGMAP) on_execute(class_definition=PiTr10GbE,regmap=REGMAP)
def test_bsn_mon(tc, io): def test_bsn_mon(tc, io):
...@@ -237,6 +272,7 @@ Cmd = { ...@@ -237,6 +272,7 @@ Cmd = {
8 : ('XAUI' , test_tr_xaui, 'using pi_tr_xaui to read xaui status'), 8 : ('XAUI' , test_tr_xaui, 'using pi_tr_xaui to read xaui status'),
9 : ('10GBE' , test_tr_10GbE,'using pi_tr_10GbE to read 10GbE status'), 9 : ('10GBE' , test_tr_10GbE,'using pi_tr_10GbE to read 10GbE status'),
10 : ('BSN' , test_bsn_mon, 'using pi_bsn_monitor to read BSN monitor'), 10 : ('BSN' , test_bsn_mon, 'using pi_bsn_monitor to read BSN monitor'),
11 : ('BG' , test_bg, 'using pi_diag_block_gen.py to read BG'),
100 : ('HELP' , show_help, 'show help on commands') 100 : ('HELP' , show_help, 'show help on commands')
} }
......
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