cpuif.py: add _ADDR and _SIZE defines for each register

Signed-off-by: Robert Jordens <jordens@gmail.com>
This commit is contained in:
Robert Jordens 2013-11-08 00:25:38 -07:00 committed by Sebastien Bourdeauducq
parent 5c5e62cc0d
commit 05944cf909
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,10 @@ from migen.bank.description import CSRStatus
def _get_rw_functions(reg_name, reg_base, size, read_only):
r = ""
r += "#define CSR_"+reg_name.upper()+"_ADDR "+hex(reg_base)+"\n"
r += "#define CSR_"+reg_name.upper()+"_SIZE "+str(size)+"\n"
if size > 8:
raise NotImplementedError("Register too large")
elif size > 4: