Skip to content
GitLab
Explore
Sign in
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
081ccb5f
Commit
081ccb5f
authored
10 years ago
by
Kenneth Hiemstra
Browse files
Options
Downloads
Patches
Plain Diff
extra
parent
157e3c6b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py
+23
-9
23 additions, 9 deletions
boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py
with
23 additions
and
9 deletions
boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py
+
23
−
9
View file @
081ccb5f
...
@@ -96,10 +96,14 @@ def test_BG_to_DB(tc,io,cmd,use_pps=False):
...
@@ -96,10 +96,14 @@ def test_BG_to_DB(tc,io,cmd,use_pps=False):
Bg
=
pi_diag_block_gen
.
PiDiagBlockGen
(
tc
,
io
,
nofChannels
=
nof_streams
,
ramSizePerChannel
=
blocksize
)
Bg
=
pi_diag_block_gen
.
PiDiagBlockGen
(
tc
,
io
,
nofChannels
=
nof_streams
,
ramSizePerChannel
=
blocksize
)
#Bg.write_block_gen_settings(samplesPerPacket=700, blocksPerSync=781250, gapSize=300, memLowAddr=0, memHighAddr=701, BSNInit=42)
#Bg.write_block_gen_settings(samplesPerPacket=700, blocksPerSync=781250, gapSize=300, memLowAddr=0, memHighAddr=701, BSNInit=42)
Db
=
pi_diag_data_buffer
.
PiDiagDataBuffer
(
tc
,
io
,
nofStreams
=
nof_streams
,
ramSizePerStream
=
blocksize
)
Db
=
pi_diag_data_buffer
.
PiDiagDataBuffer
(
tc
,
io
,
nofStreams
=
nof_streams
,
ramSizePerStream
=
blocksize
)
resetptrn
=
[
0x
ffffffff
]
*
samples_per_packet
+
[
0
]
*
(
blocksize
-
samples_per_packet
)
resetptrn
=
[
0x
c1ea1ed1
]
*
blocksize
#
samples_per_packet + [0]*(blocksize-samples_per_packet)
for
s
in
tc
.
spNrs
:
for
s
in
tc
.
spNrs
:
Db
.
overwrite_data_buffer
(
resetptrn
,
streamNr
=
s
,
vLevel
=
9
)
Db
.
overwrite_data_buffer
(
resetptrn
,
streamNr
=
s
,
vLevel
=
9
)
db_ram
=
[]
for
s
in
tc
.
spNrs
:
db_ram
.
append
(
Db
.
read_data_buffer
(
streamNr
=
s
,
vLevel
=
5
))
if
use_pps
==
True
:
if
use_pps
==
True
:
Bg
.
write_enable_pps
()
Bg
.
write_enable_pps
()
ppsh
.
wait_until_pps
(
vLevel
=
6
)
ppsh
.
wait_until_pps
(
vLevel
=
6
)
...
@@ -114,10 +118,22 @@ def test_BG_to_DB(tc,io,cmd,use_pps=False):
...
@@ -114,10 +118,22 @@ def test_BG_to_DB(tc,io,cmd,use_pps=False):
for
r
in
ram
:
rram
.
append
(
list
(
r
))
# () -> []
for
r
in
ram
:
rram
.
append
(
list
(
r
))
# () -> []
bg_ram
.
append
(
rram
)
bg_ram
.
append
(
rram
)
db_ram
=
[]
db_ram
=
[]
for
s
in
tc
.
spNrs
:
for
s
in
tc
.
spNrs
:
db_ram
.
append
(
Db
.
read_data_buffer
(
streamNr
=
s
,
vLevel
=
5
))
db_ram
.
append
(
Db
.
read_data_buffer
(
streamNr
=
s
,
vLevel
=
5
))
# truncate: in 10GbE the data is only sized 700
for
s
in
tc
.
spNrs
:
bg_ram
[
s
][
0
]
=
bg_ram
[
s
][
0
][:
-
(
blocksize
-
700
)]
db_ram
[
s
][
0
]
=
db_ram
[
s
][
0
][:
-
(
blocksize
-
700
)]
#bg_ram[s][0] = bg_ram[s][0][:-(blocksize-samples_per_packet)]
#db_ram[s][0] = db_ram[s][0][:-(blocksize-samples_per_packet)]
#print 'bg_ram=',bg_ram
#print 'db_ram=',db_ram
tc
.
set_section_id
(
'
Compare (BG==DB) -
'
)
tc
.
set_section_id
(
'
Compare (BG==DB) -
'
)
compared
=
(
bg_ram
==
db_ram
)
compared
=
(
bg_ram
==
db_ram
)
tc
.
append_log
(
3
,
''
)
tc
.
append_log
(
3
,
''
)
...
@@ -175,8 +191,7 @@ def test_info(tc,io,cmd):
...
@@ -175,8 +191,7 @@ def test_info(tc,io,cmd):
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
3
,
'
>>>
'
)
#with node_io.NodeIO(tc.nodeImages, tc.base_ip) as temp_io:
#with node_io.NodeIO(tc.nodeImages, tc.base_ip) as temp_io:
temp_io
=
node_io
.
NodeIO
(
tc
.
nodeImages
,
tc
.
base_ip
)
info
=
pi_system_info
.
PiSystemInfo
(
tc
,
io
)
info
=
pi_system_info
.
PiSystemInfo
(
tc
,
temp_io
)
tc
.
append_log
(
1
,
'
>>> reading REGMAPs
'
)
tc
.
append_log
(
1
,
'
>>> reading REGMAPs
'
)
info
.
make_register_info
()
info
.
make_register_info
()
tc
.
append_log
(
3
,
''
)
tc
.
append_log
(
3
,
''
)
...
@@ -253,11 +268,10 @@ def test_remu(tc,io,cmd):
...
@@ -253,11 +268,10 @@ def test_remu(tc,io,cmd):
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
3
,
'
>>>
'
)
dummy_tc
=
test_case
.
Testcase
(
'
Dummy TB -
'
,
''
)
dummy_tc
=
test_case
.
Testcase
(
'
Dummy TB -
'
,
''
)
#with node_io.NodeIO(tc.nodeImages, tc.base_ip) as temp_io:
temp_io
=
node_io
.
NodeIO
(
tc
.
nodeImages
,
tc
.
base_ip
)
dummy_tc
.
set_result
(
'
PASSED
'
)
dummy_tc
.
set_result
(
'
PASSED
'
)
Remu
=
pi_remu
.
PiRemu
(
dummy_tc
,
temp_io
)
#with pi_remu.PiRemu(dummy_tc, io) as Remu:
Remu
=
pi_remu
.
PiRemu
(
dummy_tc
,
io
)
try
:
try
:
Remu
.
write_user_reconfigure
()
Remu
.
write_user_reconfigure
()
except
:
except
:
...
@@ -266,7 +280,6 @@ def test_remu(tc,io,cmd):
...
@@ -266,7 +280,6 @@ def test_remu(tc,io,cmd):
if
dummy_tc
.
get_result
()
==
'
FAILED
'
:
if
dummy_tc
.
get_result
()
==
'
FAILED
'
:
tc
.
append_log
(
1
,
'
Result=%s but ignoring this
'
%
dummy_tc
.
get_result
())
tc
.
append_log
(
1
,
'
Result=%s but ignoring this
'
%
dummy_tc
.
get_result
())
del
dummy_tc
tc
.
append_log
(
3
,
''
)
tc
.
append_log
(
3
,
''
)
...
@@ -382,7 +395,7 @@ tc.append_log(3, '>>>')
...
@@ -382,7 +395,7 @@ tc.append_log(3, '>>>')
# Create access object for nodes
# Create access object for nodes
io
=
node_io
.
NodeIO
(
tc
.
nodeImages
,
tc
.
base_ip
)
#
io = node_io.NodeIO(tc.nodeImages, tc.base_ip)
...
@@ -398,7 +411,8 @@ while rep < tc.repeat:
...
@@ -398,7 +411,8 @@ while rep < tc.repeat:
if
cmd
>
len
(
Cmd
):
cmd
=
100
# default to help_text
if
cmd
>
len
(
Cmd
):
cmd
=
100
# default to help_text
tc
.
append_log
(
3
,
'
Next command: %d : %s: %s
'
%
(
cmd
,
Cmd
[
cmd
][
0
],
Cmd
[
cmd
][
2
]))
tc
.
append_log
(
3
,
'
Next command: %d : %s: %s
'
%
(
cmd
,
Cmd
[
cmd
][
0
],
Cmd
[
cmd
][
2
]))
Cmd
[
cmd
][
1
](
tc
,
io
,
cmd
)
with
node_io
.
NodeIO
(
tc
.
nodeImages
,
tc
.
base_ip
)
as
temp_io
:
Cmd
[
cmd
][
1
](
tc
,
temp_io
,
cmd
)
...
...
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