From bedf3ed9a6843bb6324e5c1e723365d86b616ca3 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 1 Sep 2015 16:57:50 +0200 Subject: [PATCH] misoclib/soc: fix add_constant when used for strings --- misoclib/soc/cpuif.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misoclib/soc/cpuif.py b/misoclib/soc/cpuif.py index 7c60db01..ac812d51 100644 --- a/misoclib/soc/cpuif.py +++ b/misoclib/soc/cpuif.py @@ -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" -- 2.30.2