Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
8c3c83e6
Commit
8c3c83e6
authored
Dec 12, 2014
by
Daniel van der Schuur
Browse files
Options
Downloads
Patches
Plain Diff
-Cleaned up the test case;
-Changed settings to 24 inputs.
parent
b46a1220
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/dsp/correlator/tb/python/tc_correlator.py
+13
-38
13 additions, 38 deletions
libraries/dsp/correlator/tb/python/tc_correlator.py
with
13 additions
and
38 deletions
libraries/dsp/correlator/tb/python/tc_correlator.py
+
13
−
38
View file @
8c3c83e6
...
@@ -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_
CHANNEL
S
)
db
=
pi_diag_data_buffer
.
PiDiagDataBuffer
(
tc
,
io
,
nofStreams
=
1
,
ramSizePerStream
=
2
*
NOF_
VISIBILITIE
S
)
###############################################################################
###############################################################################
# Read data buffer
s
# Read data buffer
# . Read NOF_
CHANNEL
S accumulator values
# . Read NOF_
VISIBILITIE
S 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
]])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment