Commit f765433c authored by Matthieu Cattin's avatar Matthieu Cattin

csr: Add function to get a register address.

parent 9bf9462d
......@@ -130,3 +130,9 @@ class CCSR:
print " - %-48s:0x%X (%d)" % (field[1][1],value, value)
if(len(reg[1][2]) != 0):
print ''
def get_reg_addr(self, reg):
if(reg in self.reg_map[1]): # test if register exist in register map
return self.reg_map[1][reg][0]
raise CSRDeviceOperationError(self.base_addr, self.reg_map, 'Requested register (%s) doesn\'t exist.'%reg)
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