misoclib/soc: fix add_constant when used for strings
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 1 Sep 2015 14:57:50 +0000 (16:57 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 1 Sep 2015 14:57:50 +0000 (16:57 +0200)
misoclib/soc/cpuif.py

index 7c60db01938735857e3a11f2691a413a2938323e..ac812d518939340332dadd84a5877519f08f0f34 100644 (file)
@@ -98,7 +98,10 @@ def get_csr_header(regions, constants, with_access_functions=True):
     for name, value in constants:
         r += "#define " + name
         if value is not None:
-            r += " " + str(value)
+            if isinstance(value, str):
+                r +=  " \"" + value + "\""
+            else:
+                r += " " + str(value)
         r += "\n"
 
     r += "\n#endif\n"