misoclib/soc: fix add_constant when used for strings

This commit is contained in:
Florent Kermarrec 2015-09-01 16:57:50 +02:00
parent a4808ace6f
commit bedf3ed9a6
1 changed files with 4 additions and 1 deletions

View 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"