From: Florent Kermarrec Date: Wed, 19 Jul 2017 10:18:35 +0000 (+0200) Subject: soc/integration/cpu_interface: do not generate constant access functions when with_ac... X-Git-Tag: 24jan2021_ls180~1816 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d05d170b75e31b97517a5c0dc7c8aaccc152f9a9;p=litex.git soc/integration/cpu_interface: do not generate constant access functions when with_access_functions is set to False --- diff --git a/litex/soc/integration/cpu_interface.py b/litex/soc/integration/cpu_interface.py index ffad5c2f..52454544 100644 --- a/litex/soc/integration/cpu_interface.py +++ b/litex/soc/integration/cpu_interface.py @@ -144,9 +144,10 @@ def get_csr_header(regions, constants, with_access_functions=True): else: value = str(value) ctype = "int" - r += "#define "+name+" "+value+"\n" - r += "static inline "+ctype+" "+name.lower()+"_read(void) {\n" - r += "\treturn "+value+";\n}\n" + r += "#define "+name+" "+value+"\n" + if with_access_functions: + r += "static inline "+ctype+" "+name.lower()+"_read(void) {\n" + r += "\treturn "+value+";\n}\n" r += "\n#endif\n" return r