From 05944cf9097d60179b6b276d7fcfaf87e842706b Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Fri, 8 Nov 2013 00:25:38 -0700 Subject: [PATCH] cpuif.py: add _ADDR and _SIZE defines for each register Signed-off-by: Robert Jordens --- misoclib/cpuif.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misoclib/cpuif.py b/misoclib/cpuif.py index b24677416..5c30289c1 100644 --- a/misoclib/cpuif.py +++ b/misoclib/cpuif.py @@ -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: