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
e0c62ce5
Commit
e0c62ce5
authored
10 years ago
by
Kenneth Hiemstra
Browse files
Options
Downloads
Patches
Plain Diff
fix test_case and test_log issues
parent
e0a2572b
Branches
Branches containing commit
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
+14
-19
14 additions, 19 deletions
boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py
with
14 additions
and
19 deletions
boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py
+
14
−
19
View file @
e0c62ce5
...
@@ -150,7 +150,10 @@ def test_BG_to_DB(tc,io,cmd):
...
@@ -150,7 +150,10 @@ def test_BG_to_DB(tc,io,cmd):
tc
.
append_log
(
3
,
''
)
tc
.
append_log
(
3
,
''
)
tc
.
append_log
(
1
,
'
>>> (BG==DB): %s
'
%
compared
)
tc
.
append_log
(
1
,
'
>>> (BG==DB): %s
'
%
compared
)
tc
.
append_log
(
3
,
''
)
tc
.
append_log
(
3
,
''
)
if
compared
==
False
:
tc
.
set_result
(
'
FAILED
'
)
if
compared
==
False
:
tc
.
set_result
(
'
FAILED
'
)
tc
.
append_log
(
1
,
'
FAILED
'
)
show_compare_arrays
(
tc
,
bg_ram
,
db_ram
)
show_compare_arrays
(
tc
,
bg_ram
,
db_ram
)
Bg
.
write_disable
()
Bg
.
write_disable
()
...
@@ -212,11 +215,14 @@ def test_info(tc,io,cmd):
...
@@ -212,11 +215,14 @@ def test_info(tc,io,cmd):
expected_design_name
=
tc
.
gpString
expected_design_name
=
tc
.
gpString
if
expected_design_name
!=
''
:
if
expected_design_name
!=
''
:
tc
.
set_section_id
(
'
Verify System Info -
'
)
tc
.
set_section_id
(
'
Verify System Info -
'
)
tc
.
append_log
(
1
,
'
>>> Verifying design_name == %s
'
%
expected_design_name
)
compared
=
True
for
name
in
design_name
:
for
name
in
design_name
:
if
(
name
!=
expected_design_name
):
if
(
name
!=
expected_design_name
):
tc
.
set_result
(
'
FAILED
'
)
tc
.
set_result
(
'
FAILED
'
)
tc
.
append_log
(
1
,
'
FAILED
'
)
compared
=
False
tc
.
append_log
(
2
,
'
>>> design_name mismatch!! (%s != %s)
'
%
(
name
,
expected_design_name
))
tc
.
append_log
(
2
,
'
>>> design_name mismatch!! (%s != %s)
'
%
(
name
,
expected_design_name
))
tc
.
append_log
(
1
,
'
>>> Verify design_name == %s: %s
'
%
(
expected_design_name
,
compared
))
...
@@ -282,7 +288,7 @@ def test_remu(tc,io,cmd):
...
@@ -282,7 +288,7 @@ def test_remu(tc,io,cmd):
tc
.
append_log
(
1
,
'
>>> %s
'
%
help_text
(
tc
,
io
,
cmd
))
tc
.
append_log
(
1
,
'
>>> %s
'
%
help_text
(
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 -
'
,
''
,
logfilename
=
'
REMU-log
'
)
dummy_tc
.
set_result
(
'
PASSED
'
)
dummy_tc
.
set_result
(
'
PASSED
'
)
Remu
=
pi_remu
.
PiRemu
(
dummy_tc
,
io
)
Remu
=
pi_remu
.
PiRemu
(
dummy_tc
,
io
)
...
@@ -413,32 +419,21 @@ signal.signal(signal.SIGINT, signal_handler)
...
@@ -413,32 +419,21 @@ signal.signal(signal.SIGINT, signal_handler)
##################################################################################################################
##################################################################################################################
# Run tests
# Run tests
nof_errors
=
0
run
=
0
run
=
0
while
tc
.
repeat
!=
0
:
# -1 for non-stop
while
tc
.
repeat
!=
0
:
# -1 for non-stop
tc
.
repeat
-=
1
tc
.
repeat
-=
1
run
+=
1
run
+=
1
tc
.
append_log
(
3
,
''
)
tc
.
append_log
(
3
,
''
)
tc
.
append_log
(
2
,
'
Run = %d
'
%
run
)
try
:
try
:
for
cmd
in
tc
.
sequence
:
for
cmd
in
tc
.
sequence
:
tc
.
append_log
(
3
,
'
Next command: %s
'
%
cmd
)
tc
.
set_section_id
(
'
Next command: %s
'
%
cmd
)
tc
.
append_log
(
1
,
'
>>> Testrun %d (@%.02fs) -
'
%
(
run
,
tc
.
get_run_time
()))
subtc
=
test_case
.
Testcase
(
'
TB %d (%.02fs) -
'
%
(
run
,
tc
.
get_run_time
()),
''
)
subtc
.
set_result
(
'
PASSED
'
)
if
cmd
==
'
REGMAP
'
:
# reload node_io:
if
cmd
==
'
REGMAP
'
:
# reload node_io:
io
=
Cmd
[
cmd
][
0
](
sub
tc
,
io
,
cmd
)
io
=
Cmd
[
cmd
][
0
](
tc
,
io
,
cmd
)
else
:
else
:
Cmd
[
cmd
][
0
](
subtc
,
io
,
cmd
)
Cmd
[
cmd
][
0
](
tc
,
io
,
cmd
)
if
subtc
.
get_result
()
==
'
FAILED
'
:
nof_errors
+=
1
tc
.
append_log
(
3
,
'
Testcase FAILED
'
)
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
set_result
(
'
FAILED
'
)
except
KeyError
:
except
KeyError
:
...
@@ -457,7 +452,7 @@ tc.append_log(3, '')
...
@@ -457,7 +452,7 @@ tc.append_log(3, '')
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
0
,
'
>>> Test bench result: %s
'
%
tc
.
get_result
())
tc
.
append_log
(
0
,
'
>>> Test bench result: %s
'
%
tc
.
get_result
())
tc
.
append_log
(
0
,
'
>>> Number of runs=%d
'
%
run
)
tc
.
append_log
(
0
,
'
>>> Number of runs=%d
'
%
run
)
tc
.
append_log
(
0
,
'
>>> Number of errors=%d
'
%
nof_errors
)
tc
.
append_log
(
0
,
'
>>> Number of errors=%d
'
%
tc
.
get_
nof_errors
()
)
tc
.
append_log
(
0
,
'
>>> Runtime=%f seconds (%f hours)
'
%
(
tc
.
get_run_time
(),
tc
.
get_run_time
()
/
3600
))
tc
.
append_log
(
0
,
'
>>> Runtime=%f seconds (%f hours)
'
%
(
tc
.
get_run_time
(),
tc
.
get_run_time
()
/
3600
))
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
3
,
'
>>>
'
)
...
...
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