Commit 1d2cc24d authored by Matthieu Cattin's avatar Matthieu Cattin

csr: Improve register map print layout.

Always print register value, even if it contains fields.
parent 9ba91a45
......@@ -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 " - %-30s:0x%X (%d)" % (field[1][1],value, value)
print ''
print " - %-48s:0x%X (%d)" % (field[1][1],value, value)
if(len(reg[1][2]) != 0):
print ''
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment