From: Florent Kermarrec Date: Tue, 1 Sep 2015 14:57:50 +0000 (+0200) Subject: misoclib/soc: fix add_constant when used for strings X-Git-Tag: 24jan2021_ls180~2126 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bedf3ed9a6843bb6324e5c1e723365d86b616ca3;p=litex.git misoclib/soc: fix add_constant when used for strings --- 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"