From: Tim 'mithro' Ansell Date: Sat, 13 Jan 2018 08:05:26 +0000 (+1100) Subject: cpu_interface: Fix indenting on constant generation. X-Git-Tag: 24jan2021_ls180~1761^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6f73cf13ca5b30a91d8a775aaa6daeb234cb66b;p=litex.git cpu_interface: Fix indenting on constant generation. This was preventing constants from getting added to the csr.h header file. --- diff --git a/litex/soc/integration/cpu_interface.py b/litex/soc/integration/cpu_interface.py index 52454544..38c5d5e7 100644 --- a/litex/soc/integration/cpu_interface.py +++ b/litex/soc/integration/cpu_interface.py @@ -144,10 +144,10 @@ def get_csr_header(regions, constants, with_access_functions=True): else: value = str(value) ctype = "int" - r += "#define "+name+" "+value+"\n" - if with_access_functions: - 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