Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
pts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
misc
pts
Commits
43dc53fb
Commit
43dc53fb
authored
May 10, 2012
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
csr: Improve register map print layout.
Always print register value, even if it contains fields.
parent
790ff35f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
csr.py
common/csr.py
+6
-5
No files found.
common/csr.py
View file @
43dc53fb
...
...
@@ -118,14 +118,15 @@ class CCSR:
# Print all register map
def
print_reg_map
(
self
):
print
"
%
s register map
:"
%
(
self
.
reg_map
[
0
])
print
"
\n
%
s
:"
%
(
self
.
reg_map
[
0
])
print
"--------------------------------------------------"
# loop over registers and sort them by address offset
for
reg
in
sorted
(
self
.
reg_map
[
1
]
.
iteritems
(),
key
=
lambda
(
k
,
v
):
v
[
0
]):
print
"
%
s register:"
%
(
reg
[
1
][
1
])
value
=
self
.
get_reg
(
reg
[
0
])
print
" *
%-50
s:0x
%08
X (
%
d)"
%
(
reg
[
1
][
1
],
value
,
value
)
# loop over fields and sort them by position
for
field
in
sorted
(
reg
[
1
][
2
]
.
iteritems
(),
key
=
lambda
(
k
,
v
):
v
[
0
]):
value
=
self
.
get_field
(
reg
[
0
],
field
[
0
])
print
"
-
%-30
s:0x
%
X (
%
d)"
%
(
field
[
1
][
1
],
value
,
value
)
print
''
print
"
-
%-48
s:0x
%
X (
%
d)"
%
(
field
[
1
][
1
],
value
,
value
)
if
(
len
(
reg
[
1
][
2
])
!=
0
):
print
''
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