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
1a25e39f
Commit
1a25e39f
authored
10 years ago
by
Kenneth Hiemstra
Browse files
Options
Downloads
Patches
Plain Diff
better error handling
parent
d9e9e5ce
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
+22
-7
22 additions, 7 deletions
boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py
with
22 additions
and
7 deletions
boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py
+
22
−
7
View file @
1a25e39f
...
...
@@ -133,9 +133,11 @@ def test_BG_to_DB(tc,io,cmd):
# 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
)]
for
bg
in
bg_ram
:
bg
[
0
]
=
bg
[
0
][:
-
(
blocksize
-
700
)]
for
db
in
db_ram
:
db
[
0
]
=
db
[
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)]
...
...
@@ -404,6 +406,7 @@ io = node_io.NodeIO(tc.nodeImages, tc.base_ip)
##################################################################################################################
# Run tests
nof_errors
=
0
rep
=
0
while
rep
<
tc
.
repeat
:
rep
+=
1
...
...
@@ -414,17 +417,28 @@ while rep < tc.repeat:
for
cmd
in
tc
.
sequence
:
tc
.
append_log
(
3
,
'
Next command: %s : %s: %s
'
%
(
cmd
,
Cmd
[
cmd
][
1
],
Cmd
[
cmd
][
2
]))
subtc
=
test_case
.
Testcase
(
'
SUBTB -
'
,
''
)
subtc
.
set_result
(
'
PASSED
'
)
if
cmd
==
'
INFO
'
:
# reload node_io:
io
=
Cmd
[
cmd
][
0
](
tc
,
io
,
cmd
)
io
=
Cmd
[
cmd
][
0
](
sub
tc
,
io
,
cmd
)
else
:
Cmd
[
cmd
][
0
](
tc
,
io
,
cmd
)
Cmd
[
cmd
][
0
](
subtc
,
io
,
cmd
)
if
subtc
.
get_result
()
==
'
FAILED
'
:
nof_errors
+=
1
tc
.
append_log
(
3
,
'
This test FAILED
'
)
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
set_result
(
'
FAILED
'
)
except
KeyError
:
print
'
Unknown command:
'
,
cmd
cmd
=
'
help
'
Cmd
[
cmd
][
0
](
tc
,
io
,
cmd
)
except
:
print
'
Catched error:
'
,
sys
.
exc_info
()[
0
]
#
except:
#
print 'Catched error:',sys.exc_info()[0]
...
...
@@ -434,6 +448,7 @@ tc.set_section_id('')
tc
.
append_log
(
3
,
''
)
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
0
,
'
>>> Test bench result: %s
'
%
tc
.
get_result
())
tc
.
append_log
(
0
,
'
>>> Number of errors=%d
'
%
nof_errors
)
tc
.
append_log
(
3
,
'
>>>
'
)
sys
.
exit
(
tc
.
get_result
())
...
...
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