Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pts-base
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
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
This is an archived project. Repository and other project resources are read-only.
misc
pts-base
Commits
1d2cc24d
Commit
1d2cc24d
authored
12 years ago
by
Matthieu Cattin
Browse files
Options
Downloads
Patches
Plain Diff
csr: Improve register map print layout.
Always print register value, even if it contains fields.
parent
9ba91a45
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/csr.py
+6
-5
6 additions, 5 deletions
common/csr.py
with
6 additions
and
5 deletions
common/csr.py
+
6
−
5
View file @
1d2cc24d
...
...
@@ -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
"
* %-50s:0x%08X (%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
''
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