Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Software
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Dmytro Levit
Software
Commits
4aacd9c3
Commit
4aacd9c3
authored
5 years ago
by
Patrick Robbe
Browse files
Options
Downloads
Patches
Plain Diff
Improve test script
parent
019df9ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Scripts/testB2L.py
+30
-23
30 additions, 23 deletions
Scripts/testB2L.py
with
30 additions
and
23 deletions
Scripts/testB2L.py
+
30
−
23
View file @
4aacd9c3
...
...
@@ -54,18 +54,25 @@ def _crc16(data, crc, table):
crc
=
((
crc
<<
8
)
&
0xff00
)
^
table
[((
crc
>>
8
)
&
0xff
)
^
byte1
]
return
crc
&
0xffff
for
nev
in
range
(
10
0
):
for
nev
in
range
(
10
):
# Send trigger
os
.
system
(
"
ssh vme
\"
trigft -80 pulse 1 1
\"
>/dev/null 2>&1
"
)
# Send trigger
(adapt this line to your system)
os
.
system
(
"
ssh vme
\"
trigft -80 pulse 1 1
\"
"
)
### ADD this to suppress output
>/dev/null 2>&1" )
# wait for data to arrive
attempt
=
0
size
=
0
while
size
!=
892
:
status
,
val
=
mem
.
read
(
0
,
0x00050080
)
size
=
val
attempt
=
attempt
+
1
if
attempt
>
1000
:
for
i
in
range
(
10000
):
mem
.
read
(
0
,
0x00050060
)
print
'
Error in reading: try again now
'
exit
(
0
)
#
print "Number of words received = {}".format( size )
print
"
Number of words received = {}
"
.
format
(
size
)
# read data
...
...
@@ -80,26 +87,26 @@ for nev in range( 100 ):
data_crc
.
append
(
(
val
&
0xFFFF0000
)
>>
16
)
# Display data:
#
print '==================================='
#
print 'B2L: {:08x}'.format(data[0])
#
print 'B2L: {:08x}'.format(data[1])
#
print 'B2L: {:08x}'.format(data[2])
#
print 'B2L: {:08x}'.format(data[3])
#
print 'B2L: {:08x}'.format(data[4])
#
print '-----------------------------------'
#
print 'FEE: data #0 {:08x}'.format(data[5])
#
print 'FEE: data #1 {:08x}'.format(data[6])
#
print 'FEE: ..........'
#
print 'FEE: data #{} {:08x}'.format(size/2-7,data[size/2-4])
#
print '-----------------------------------'
#
print 'B2L: {:08x}'.format(data[size/2-3])
#
print 'B2L: {:08x}'.format(data[size/2-2])
#
print '==================================='
#
print ''
#
print 'CRC = {:04x}'.format(data[size/2-2]&0xFFFF)
#
print 'Computed CRC {:04x}'.format(_crc16( data_crc, 0xffff , CRC16_XMODEM_TABLE ) )
print
'
===================================
'
print
'
B2L: {:08x}
'
.
format
(
data
[
0
])
print
'
B2L: {:08x}
'
.
format
(
data
[
1
])
print
'
B2L: {:08x}
'
.
format
(
data
[
2
])
print
'
B2L: {:08x}
'
.
format
(
data
[
3
])
print
'
B2L: {:08x}
'
.
format
(
data
[
4
])
print
'
-----------------------------------
'
print
'
FEE: data #0 {:08x}
'
.
format
(
data
[
5
])
print
'
FEE: data #1 {:08x}
'
.
format
(
data
[
6
])
print
'
FEE: ..........
'
print
'
FEE: data #{} {:08x}
'
.
format
(
size
/
2
-
7
,
data
[
size
/
2
-
4
])
print
'
-----------------------------------
'
print
'
B2L: {:08x}
'
.
format
(
data
[
size
/
2
-
3
])
print
'
B2L: {:08x}
'
.
format
(
data
[
size
/
2
-
2
])
print
'
===================================
'
print
''
print
'
CRC = {:04x}
'
.
format
(
data
[
size
/
2
-
2
]
&
0xFFFF
)
print
'
Computed CRC {:04x}
'
.
format
(
_crc16
(
data_crc
,
0xffff
,
CRC16_XMODEM_TABLE
)
)
if
(
data
[
size
/
2
-
2
]
&
0xFFFF
)
!=
(
_crc16
(
data_crc
,
0xffff
,
CRC16_XMODEM_TABLE
)
):
print
'
E
RREUR
'
print
'
E
rror in CRC comparison
'
nErr
=
nErr
+
1
print
'
number of errors = {}
'
.
format
(
nErr
)
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