Skip to content
Snippets Groups Projects
Commit 4c49c0e9 authored by Pepping's avatar Pepping
Browse files

Added databuffer

parent a0cbc066
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,7 @@ tc = test_case.Testcase('TB - ', '') ...@@ -64,6 +64,7 @@ tc = test_case.Testcase('TB - ', '')
g_nof_input_streams = 12 # 16 g_nof_input_streams = 12 # 16
g_blocks_per_sync = 800000 #32 # 781250 g_blocks_per_sync = 800000 #32 # 781250
if tc.sim == True: if tc.sim == True:
g_blocks_per_sync = 16 # 781250 g_blocks_per_sync = 16 # 781250
...@@ -71,6 +72,8 @@ if tc.sim == True: ...@@ -71,6 +72,8 @@ if tc.sim == True:
# Define settings for the block generator # Define settings for the block generator
c_bg_nof_streams = g_nof_input_streams c_bg_nof_streams = g_nof_input_streams
c_bg_ram_size = 128 c_bg_ram_size = 128
c_db_nof_streams = g_nof_input_streams
c_db_ram_size = c_bg_ram_size
c_samples_per_packet = 128 c_samples_per_packet = 128
c_gapsize = 64 c_gapsize = 64
c_mem_low_addr = 0 c_mem_low_addr = 0
...@@ -79,7 +82,7 @@ c_bsn_init = 42 ...@@ -79,7 +82,7 @@ c_bsn_init = 42
c_in_dat_w = 16 c_in_dat_w = 16
c_write_bg_data = False c_write_bg_data = False
c_write_bg_data_to_file = False c_write_bg_data_to_file = True
tc.append_log(3, '>>>') tc.append_log(3, '>>>')
tc.append_log(1, '>>> Title : Test script for unb1_board_bg_mesh_db' ) tc.append_log(1, '>>> Title : Test script for unb1_board_bg_mesh_db' )
...@@ -93,8 +96,8 @@ io = node_io.NodeIO(tc.nodeImages, tc.base_ip) ...@@ -93,8 +96,8 @@ io = node_io.NodeIO(tc.nodeImages, tc.base_ip)
# Create block generator instance # Create block generator instance
bg = pi_diag_block_gen.PiDiagBlockGen(tc, io, g_nof_input_streams, c_bg_ram_size) bg = pi_diag_block_gen.PiDiagBlockGen(tc, io, g_nof_input_streams, c_bg_ram_size)
# BSN monitor # Create databuffer instances
bsn_out = pi_bsn_monitor.PiBsnMonitor(tc, io, instanceName='', nofStreams=g_nof_input_streams) db = pi_diag_data_buffer.PiDiagDataBuffer(tc, io, instanceName = '', nofStreams=c_db_nof_streams, ramSizePerStream=c_db_ram_size)
# Create dsp_test instance for helpful methods # Create dsp_test instance for helpful methods
dsp_test_bg = dsp_test.DspTest(inDatW=c_in_dat_w) dsp_test_bg = dsp_test.DspTest(inDatW=c_in_dat_w)
...@@ -103,9 +106,6 @@ pps = pi_ppsh.PiPpsh(tc, io, nodeNr=tc.nodeFnNrs) ...@@ -103,9 +106,6 @@ pps = pi_ppsh.PiPpsh(tc, io, nodeNr=tc.nodeFnNrs)
if __name__ == "__main__": if __name__ == "__main__":
bsn_out.read_bsn_monitor(0)
bsn_out.read_bsn_monitor(1)
################################################################################ ################################################################################
## ##
## Initialize the blockgenerators ## Initialize the blockgenerators
...@@ -124,7 +124,6 @@ if __name__ == "__main__": ...@@ -124,7 +124,6 @@ if __name__ == "__main__":
tc.append_log(3, '>>>') tc.append_log(3, '>>>')
inputData = [] inputData = []
dataList=[] dataList=[]
for i in xrange(0, g_nof_input_streams): for i in xrange(0, g_nof_input_streams):
data = [] data = []
...@@ -145,18 +144,23 @@ if __name__ == "__main__": ...@@ -145,18 +144,23 @@ if __name__ == "__main__":
# - Enable the block generator # - Enable the block generator
tc.append_log(3, '>>>') tc.append_log(3, '>>>')
tc.append_log(3, '>>> Arm the block generator') tc.append_log(3, '>>> Start the block generator')
tc.append_log(3, '>>>') tc.append_log(3, '>>>')
tc.append_log(3, '') tc.append_log(3, '')
# toggle = pps.read_ppsh_toggle()
# do_until_ne(pps.read_ppsh_toggle, ms_retry=1000, val=toggle, s_timeout=13600)
bg.write_enable() bg.write_enable()
bsn_out.read_bsn_monitor(0) do_until_ge(db.read_nof_words, ms_retry=3000, val=c_db_ram_size, s_timeout=3600)
bsn_out.read_bsn_monitor(1)
###############################################################################
#
# Read data from data buffer
#
###############################################################################
db_out = []
for i in range(c_bg_nof_streams):
db_out.append(flatten(db_re.read_data_buffer(streamNr=i, n=c_db_ram_size, radix='uns', width=c_in_dat_w, nofColumns=8)))
############################################################################### ###############################################################################
# End # End
tc.set_section_id('') tc.set_section_id('')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment