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
c2bc38d7
Commit
c2bc38d7
authored
10 years ago
by
Kenneth Hiemstra
Browse files
Options
Downloads
Patches
Plain Diff
enhanced
parent
2109532a
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
+27
-17
27 additions, 17 deletions
boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py
with
27 additions
and
17 deletions
boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py
+
27
−
17
View file @
c2bc38d7
...
...
@@ -48,6 +48,7 @@ Description:
###############################################################################
# System imports
import
sys
import
signal
import
test_case
import
node_io
import
pi_system_info
...
...
@@ -75,17 +76,17 @@ def show_compare_arrays(tc,a,b):
return
(
not
False
in
compared
)
def
test_BG_to_DB
(
tc
,
io
,
cmd
):
tc
.
set_section_id
(
'
Test BG -
'
)
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
1
,
'
>>> %s
'
%
help_text
(
tc
,
io
,
cmd
))
tc
.
append_log
(
3
,
'
>>>
'
)
if
tc
.
number
==
1
:
use_pps
=
True
tc
.
append_log
(
1
,
'
>>> Using PPS
'
)
tc
.
set_section_id
(
'
Test BG-DB (pps) -
'
)
else
:
use_pps
=
False
tc
.
append_log
(
1
,
'
>>> NOT Using PPS
'
)
tc
.
set_section_id
(
'
Test BG-DB (nopps) -
'
)
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
1
,
'
>>> %s
'
%
help_text
(
tc
,
io
,
cmd
))
tc
.
append_log
(
3
,
'
>>>
'
)
if
use_pps
==
True
:
ppsh
=
pi_ppsh
.
PiPpsh
(
tc
,
io
)
...
...
@@ -377,7 +378,7 @@ def help_text(tc,io,cmd):
tc
.
append_log
(
0
,
''
)
tc
.
append_log
(
0
,
'
[reset, load user img] sequence: --seq REGMAP,WDI,REGMAP,REMU,REGMAP,INFO
'
)
tc
.
append_log
(
0
,
'
[flash+start user img] sequence: --seq FLASH,WDI,REGMAP,REMU,REGMAP,INFO -s file.rbf
'
)
tc
.
append_log
(
0
,
'
[re-read info,sensors] sequence: --seq INFO,PPSH,SENSORS --rep 1
0
-s expected_design_name
'
)
tc
.
append_log
(
0
,
'
[re-read info,sensors] sequence: --seq INFO,PPSH,SENSORS --rep
-
1 -s expected_design_name
'
)
tc
.
append_log
(
0
,
'
[reset to factory] sequence: --seq WDI,REGMAP
'
)
tc
.
append_log
(
0
,
'
[program user image] sequence: --seq FLASH -s file.rbf
'
)
tc
.
append_log
(
0
,
'
[load user image] sequence: --seq REMU,REGMAP
'
)
...
...
@@ -387,6 +388,9 @@ def help_text(tc,io,cmd):
return
str
def
signal_handler
(
signal
,
frame
):
print
(
'
You pressed Ctrl+C!
'
)
tc
.
repeat
=
0
##################################################################################################################
...
...
@@ -398,37 +402,41 @@ tc.set_result('PASSED')
dgnName
=
tc
.
gpString
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
1
,
'
>>> Title : Test bench (%s) on nodes %s, %s
'
%
(
sys
.
argv
[
0
],
tc
.
unb_nodes_string
(
''
),
dgnName
))
tc
.
append_log
(
1
,
'
>>> Commandline : %s
'
%
"
"
.
join
(
sys
.
argv
))
tc
.
append_log
(
3
,
'
>>>
'
)
# Create access object for nodes
io
=
node_io
.
NodeIO
(
tc
.
nodeImages
,
tc
.
base_ip
)
signal
.
signal
(
signal
.
SIGINT
,
signal_handler
)
##################################################################################################################
# Run tests
nof_errors
=
0
rep
=
0
while
rep
<
tc
.
repeat
:
rep
+=
1
run
=
0
while
tc
.
repeat
!=
0
:
# -1 for non-stop
tc
.
repeat
-=
1
run
+=
1
tc
.
append_log
(
3
,
''
)
tc
.
append_log
(
2
,
'
R
ep
= %d
'
%
r
ep
)
tc
.
append_log
(
2
,
'
R
un
= %d
'
%
r
un
)
try
:
for
cmd
in
tc
.
sequence
:
tc
.
append_log
(
3
,
'
Next command: %s
: %s: %s
'
%
(
cmd
,
Cmd
[
cmd
][
1
],
Cmd
[
cmd
][
2
])
)
tc
.
append_log
(
3
,
'
Next command: %s
'
%
cmd
)
subtc
=
test_case
.
Testcase
(
'
SUBTB -
'
,
''
)
subtc
=
test_case
.
Testcase
(
'
TB %d (%.02fs) -
'
%
(
run
,
tc
.
get_run_time
())
,
''
)
subtc
.
set_result
(
'
PASSED
'
)
if
cmd
==
'
INFO
'
:
# reload node_io:
if
cmd
==
'
REGMAP
'
:
# reload node_io:
io
=
Cmd
[
cmd
][
0
](
subtc
,
io
,
cmd
)
else
:
Cmd
[
cmd
][
0
](
subtc
,
io
,
cmd
)
if
subtc
.
get_result
()
==
'
FAILED
'
:
nof_errors
+=
1
tc
.
append_log
(
3
,
'
T
his test
FAILED
'
)
tc
.
append_log
(
3
,
'
T
estcase
FAILED
'
)
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
set_result
(
'
FAILED
'
)
...
...
@@ -448,7 +456,9 @@ 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 runs=%d
'
%
run
)
tc
.
append_log
(
0
,
'
>>> Number of errors=%d
'
%
nof_errors
)
tc
.
append_log
(
0
,
'
>>> Runtime=%f seconds (%f hours)
'
%
(
tc
.
get_run_time
(),
tc
.
get_run_time
()
/
3600
))
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