Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL Blocking
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL Blocking
Commits
5ff3bc00
Commit
5ff3bc00
authored
Feb 15, 2017
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests/pulse_rejection: read first the error reg and then counters
parent
be9188fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
pulse_rejection.py
software/tests/pulse_rejection.py
+18
-13
No files found.
software/tests/pulse_rejection.py
View file @
5ff3bc00
...
@@ -101,23 +101,25 @@ for test in tests:
...
@@ -101,23 +101,25 @@ for test in tests:
# test if all pulses pass through
# test if all pulses pass through
while
(
test_run
):
while
(
test_run
):
if
(
old_counters
!=
convttl
.
pulse_counters
):
errors
=
convttl
.
error
.
error_reg
print
(
convttl
.
pulse_counters
)
counters
=
convttl
.
pulse_counters
old_counters
=
convttl
.
pulse_counters
if
(
old_counters
!=
counters
):
print
(
counters
)
old_counters
=
counters
for
ch
in
convttl
.
CHANNELS
:
for
ch
in
convttl
.
CHANNELS
:
# set of missed pulse error flags for this channel
# set of missed pulse error flags for this channel
pulse_missed_errors
=
(
convttl
.
error
.
ERRORS_MASK_FLIM_MISSED
(
ch
),
pulse_missed_errors
=
(
convttl
.
error
.
ERRORS_MASK_FLIM_MISSED
(
ch
),
convttl
.
error
.
ERRORS_MASK_FWDG_MISSED
(
ch
))
convttl
.
error
.
ERRORS_MASK_FWDG_MISSED
(
ch
))
if
old_counters
[
ch
-
1
][
0
]
!=
0
and
old_
counters
[
ch
-
1
][
1
]
!=
0
:
if
counters
[
ch
-
1
][
0
]
!=
0
and
counters
[
ch
-
1
][
1
]
!=
0
:
print
(
"WARNING: Both pulse counters are increasing, check if it is ok"
)
print
(
"WARNING: Both pulse counters are increasing, check if it is ok"
)
pulse_count
=
max
(
old_counters
[
ch
-
1
])
pulse_count
=
max
(
old_counters
[
ch
-
1
])
# check if there were any pulses missed
# check if there were any pulses missed
if
any
(
error
in
convttl
.
error
for
error
in
pulse_missed_errors
):
if
any
(
error
_bit
&
errors
for
error_bit
in
pulse_missed_errors
):
if
(
pulse_count
<=
pulses
):
if
(
pulse_count
<=
pulses
):
print
(
"TEST FAILED: channel
%
d missed a pulse (
%
d)"
%
(
ch
,
pulse_count
))
print
(
"TEST FAILED: channel
%
d missed a pulse (
%
d)"
%
(
ch
,
pulse_count
))
sys
.
exit
(
2
)
sys
.
exit
(
2
)
...
@@ -160,14 +162,17 @@ for test in tests:
...
@@ -160,14 +162,17 @@ for test in tests:
# test if pulses are rejected after a certain threshold
# test if pulses are rejected after a certain threshold
while
(
test_run
):
while
(
test_run
):
errors
=
convttl
.
error
.
error_reg
counters
=
convttl
.
pulse_counters
if
(
old_counters
!=
convttl
.
pulse_counters
):
if
(
old_counters
!=
counters
):
print
(
convttl
.
pulse_counters
)
print
(
counters
)
old_counters
=
counters
old_counters
=
convttl
.
pulse_counters
for
ch
in
range
(
1
,
7
):
for
ch
in
convttl
.
CHANNELS
:
pulse_missed_errors
=
(
convttl
.
ERRORS_MASK_FLIM_MISSED
(
ch
),
convttl
.
ERRORS_MASK_FWDG_MISSED
(
ch
))
# set of missed pulse error flags for this channel
pulse_missed_errors
=
(
convttl
.
error
.
ERRORS_MASK_FLIM_MISSED
(
ch
),
convttl
.
error
.
ERRORS_MASK_FWDG_MISSED
(
ch
))
if
old_counters
[
ch
-
1
][
0
]
!=
0
and
old_counters
[
ch
-
1
][
1
]
!=
0
:
if
old_counters
[
ch
-
1
][
0
]
!=
0
and
old_counters
[
ch
-
1
][
1
]
!=
0
:
print
(
"WARNING: Both pulse counters are increasing, check if it is ok"
)
print
(
"WARNING: Both pulse counters are increasing, check if it is ok"
)
...
@@ -175,7 +180,7 @@ for test in tests:
...
@@ -175,7 +180,7 @@ for test in tests:
pulse_count
=
max
(
old_counters
[
ch
-
1
])
pulse_count
=
max
(
old_counters
[
ch
-
1
])
# check if there were any pulses missed
# check if there were any pulses missed
if
any
(
error
in
convttl
.
error
for
error
in
pulse_missed_errors
):
if
any
(
error
_bit
&
errors
for
error_bit
in
pulse_missed_errors
):
if
(
pulse_count
<=
pulses
):
if
(
pulse_count
<=
pulses
):
print
(
"TEST FAILED: channel
%
d missed a pulse too early (
%
d)"
%
(
ch
,
pulse_count
))
print
(
"TEST FAILED: channel
%
d missed a pulse too early (
%
d)"
%
(
ch
,
pulse_count
))
sys
.
exit
(
2
)
sys
.
exit
(
2
)
...
@@ -189,7 +194,7 @@ for test in tests:
...
@@ -189,7 +194,7 @@ for test in tests:
# even if the test was passed, wait for the end of current pulse burst
# even if the test was passed, wait for the end of current pulse burst
if
(
pulse_count
>=
pulses
*
2
):
if
(
pulse_count
>=
pulses
*
2
):
if
not
any
(
error
in
convttl
.
error
for
error
in
pulse_missed_errors
):
if
not
any
(
error
&
errors
for
error
in
pulse_missed_errors
):
print
(
"TEST FAILED: repeated
%
d pulses, none rejected"
%
(
pulse_count
))
print
(
"TEST FAILED: repeated
%
d pulses, none rejected"
%
(
pulse_count
))
sys
.
exit
(
2
)
sys
.
exit
(
2
)
test_run
=
False
test_run
=
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment