Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Conv TTL Blocking
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Projects
Conv TTL Blocking
Commits
425f16cd
Commit
425f16cd
authored
8 years ago
by
Projects
Browse files
Options
Downloads
Patches
Plain Diff
diag/getsr: update HWVERS offset & mask
parent
9d14c910
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
software/diag/getsr.py
+11
-9
11 additions, 9 deletions
software/diag/getsr.py
with
11 additions
and
9 deletions
software/diag/getsr.py
+
11
−
9
View file @
425f16cd
...
...
@@ -32,6 +32,7 @@
# in turn.
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
# Updated HWVERS mask & offset
#===============================================================================
# TODO: -
#===============================================================================
...
...
@@ -68,11 +69,11 @@ if __name__ == "__main__":
print
(
"
===============================
"
)
# Strip GWVERS and print
maj
=
(
v
&
0xf0
)
>>
4
min
=
v
&
0x0f
print
(
"
Gateware version : v%d.%d (0x%02x)
"
%
(
maj
,
min
,
v
&
0xff
))
gw
maj
=
(
v
&
0xf0
)
>>
4
gw
min
=
v
&
0x0f
print
(
"
Gateware version : v%d.%d (0x%02x)
"
%
(
gw
maj
,
gw
min
,
v
&
0xff
))
if
maj
<
4
:
if
gw
maj
<
4
:
print
(
"
This tool works with gateware v4. Please upgrade your gateware.
"
)
sys
.
exit
()
...
...
@@ -84,7 +85,7 @@ if __name__ == "__main__":
# Gateware versions below these two had the switches active-low.
# This negation is done to allow correct printing of ON or OFF states.
if
((
bid
==
"
TBLO
"
)
and
(((
maj
==
0
)
and
(
min
<
2
))
or
((
maj
!=
0
)
and
(
maj
<
3
)))):
(((
gw
maj
==
0
)
and
(
gw
min
<
2
))
or
((
gw
maj
!=
0
)
and
(
gw
maj
<
3
)))):
switches
^=
0xff
if
(
switches
&
0x80
):
print
(
"
TTL mode : TTL
"
)
...
...
@@ -104,19 +105,20 @@ if __name__ == "__main__":
rtmm
=
rtm
&
0x7
rtmp
=
(
rtm
&
0x3f
)
>>
3
if
((
bid
==
"
TBLO
"
)
and
(((
maj
==
0
)
and
(
min
<
2
))
or
((
maj
!=
0
)
and
(
maj
<
3
)))):
(((
gw
maj
==
0
)
and
(
gw
min
<
2
))
or
((
gw
maj
!=
0
)
and
(
gw
maj
<
3
)))):
print
(
"
-------------------------------
"
)
print
(
"
Note: negated w.r.t. latest user guide version
"
)
print
(
"
RTM detection : 0x%02x
"
%
rtm
)
print
(
"
RTMM[2:0] : %s
"
%
(
"
{0:#05b}
"
.
format
(
rtmm
)[
2
:]))
print
(
"
RTMP[2:0] : %s
"
%
(
"
{0:#05b}
"
.
format
(
rtmp
)[
2
:]))
if
((
maj
==
0
)
and
(
min
<
2
))
or
(
maj
<
3
):
if
((
gw
maj
==
0
)
and
(
gw
min
<
2
))
or
(
gw
maj
<
3
):
print
(
"
-------------------------------
"
)
# Hardware version
hwver
=
(
v
&
0x03c00000
)
>>
22
hwmaj
=
(
v
&
0x0f000000
)
>>
24
hwmin
=
(
v
&
0x00c00000
)
>>
22
print
(
"
Hardware version : %s
"
%
(
str
(
hwver
)
if
hw
ver
>=
4
else
"
3 or below
"
))
%
(
"
%d.%d
"
%
(
hwmaj
,
hwmin
)
if
hw
maj
>=
4
else
"
3 or below
"
))
# White Rabbit present
wrpres
=
(
v
&
0x04000000
)
>>
8
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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