Skip to content
Snippets Groups Projects
Commit 8c3c83e6 authored by Daniel van der Schuur's avatar Daniel van der Schuur
Browse files

-Cleaned up the test case;

-Changed settings to 24 inputs.
parent b46a1220
Branches
No related tags found
No related merge requests found
...@@ -31,35 +31,21 @@ import pi_diag_data_buffer ...@@ -31,35 +31,21 @@ import pi_diag_data_buffer
# Description: # Description:
# Usage: # Usage:
COMPLEX_WIDTH = 16 NOF_INPUTS = 24
NOF_INPUTS = 10 NOF_VISIBILITIES = (NOF_INPUTS*(NOF_INPUTS+1))/2
NOF_OUTPUTS = NOF_INPUTS*(NOF_INPUTS+1)/2
NOF_CHANNELS = 64 NOF_CHANNELS = 64
BUFFER_WIDTH = 64 BUFFER_WIDTH = 64
tc = test_case.Testcase('TB - ', '') tc = test_case.Testcase('TB - ', '')
io = node_io.NodeIO(tc.nodeImages, tc.base_ip) io = node_io.NodeIO(tc.nodeImages, tc.base_ip)
db = pi_diag_data_buffer.PiDiagDataBuffer(tc, io, nofStreams=NOF_OUTPUTS, ramSizePerStream=2*NOF_CHANNELS) db = pi_diag_data_buffer.PiDiagDataBuffer(tc, io, nofStreams=1, ramSizePerStream=2*NOF_VISIBILITIES)
############################################################################### ###############################################################################
# Read data buffers # Read data buffer
# . Read NOF_CHANNELS accumulator values # . Read NOF_VISIBILITIES accumulator values
############################################################################### ###############################################################################
data = [] #do_until_ge(db.read_nof_words, ms_retry=20000, val=NOF_VISIBILITIES, s_timeout=1800)
data = db.read_data_buffer(streamNr=0, n=2*NOF_VISIBILITIES, radix='uns', width=BUFFER_WIDTH, nofColumns=12)[0]
#do_until_ge(db.read_nof_words, ms_retry=2000, val=55, s_timeout=900)
#for output_nr in range(NOF_OUTPUTS):
data = db.read_data_buffer(streamNr=0, n=2*55, radix='uns', width=BUFFER_WIDTH, nofColumns=12)[0]
###############################################################################
# 'data' is now a 2d array of [NOF_OUTPUTS][NOF_CHANNELS]. We
# want to group the outputs by channel, so transpose this 2d array into
# [NOF_CHANNELS][NOF_OUTPUTS]
###############################################################################
#data = transpose(data)
print data
mat_list = []
amplitudes = []
############################################################################### ###############################################################################
# Convert the unsigned words to complex # Convert the unsigned words to complex
...@@ -67,9 +53,9 @@ amplitudes = [] ...@@ -67,9 +53,9 @@ amplitudes = []
channel_data = data channel_data = data
for index,word in enumerate(channel_data): for index,word in enumerate(channel_data):
word_bits = CommonBits(word, BUFFER_WIDTH) word_bits = CommonBits(word, BUFFER_WIDTH)
re = word_bits[BUFFER_WIDTH-1:BUFFER_WIDTH/2] im = word_bits[BUFFER_WIDTH-1:BUFFER_WIDTH/2]
im = word_bits[BUFFER_WIDTH/2-1:0] re = word_bits[BUFFER_WIDTH/2-1:0]
channel_data[index] = complex(im, re) channel_data[index] = complex(re, im)
############################################################################### ###############################################################################
# Convert binomials to complex phasor notation # Convert binomials to complex phasor notation
...@@ -81,26 +67,15 @@ for index,word in enumerate(channel_data): ...@@ -81,26 +67,15 @@ for index,word in enumerate(channel_data):
# Extract the phases and amplitudes from the complex data # Extract the phases and amplitudes from the complex data
############################################################################### ###############################################################################
phases = [] phases = []
amplitudes = []
for word in channel_data: for word in channel_data:
amplitudes.append(word[0]) amplitudes.append(word[0])
phases.append(word[1]) phases.append(word[1])
################################################################################ ################################################################################
# Re-shape the flat list into a matrix # Re-shape the flat list into a matrix and plot the matrix
################################################################################ ################################################################################
mat = unique_vis_to_full_matrix(phases) mat = unique_vis_to_full_matrix(phases)
#mat_list.append(mat) print 'AMPLITUDES', amplitudes
################################################################################
# re-shape the flat list of 64 matrices into a an 8*8 matrix of matrices, plot
################################################################################
#print 'Plotting phases of %d channels.' %NOF_CHANNELS
#print '. Channel amplitudes:'
#for channel_nr in range(NOF_CHANNELS):
# print ' .', channel_nr, ' - ', amplitudes[channel_nr]
#mat_mat = split_list(mat_list, 8)
plot_matrix_color([[mat]]) plot_matrix_color([[mat]])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment