cpu_interface: Fix indenting on constant generation.
authorTim 'mithro' Ansell <me@mith.ro>
Sat, 13 Jan 2018 08:05:26 +0000 (19:05 +1100)
committerTim 'mithro' Ansell <me@mith.ro>
Sat, 13 Jan 2018 08:05:26 +0000 (19:05 +1100)
This was preventing constants from getting added to the csr.h header
file.

litex/soc/integration/cpu_interface.py

index 5245454486d705284c18021034f2543b46bda54d..38c5d5e724b8a8efcca96edb9d6173785f27e535 100644 (file)
@@ -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