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
425f16cd
Commit
425f16cd
authored
Feb 17, 2017
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
diag/getsr: update HWVERS offset & mask
parent
9d14c910
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
getsr.py
software/diag/getsr.py
+11
-9
No files found.
software/diag/getsr.py
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
%02
x)"
%
(
maj
,
min
,
v
&
0xff
))
gw
maj
=
(
v
&
0xf0
)
>>
4
gw
min
=
v
&
0x0f
print
(
"Gateware version : v
%
d.
%
d (0x
%02
x)"
%
(
gwmaj
,
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
)))):
(((
gwmaj
==
0
)
and
(
gwmin
<
2
))
or
((
gwmaj
!=
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
)))):
(((
gwmaj
==
0
)
and
(
gwmin
<
2
))
or
((
gwmaj
!=
0
)
and
(
gw
maj
<
3
)))):
print
(
"-------------------------------"
)
print
(
"Note: negated w.r.t. latest user guide version"
)
print
(
"RTM detection : 0x
%02
x"
%
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
((
gwmaj
==
0
)
and
(
gwmin
<
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
hwver
>=
4
else
"3 or below"
))
%
(
"
%
d.
%
d"
%
(
hwmaj
,
hwmin
)
if
hwmaj
>=
4
else
"3 or below"
))
# White Rabbit present
wrpres
=
(
v
&
0x04000000
)
>>
8
...
...
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