soc/integration/cpu_interface: do not generate constant access functions when with_access_functions is set to False

This commit is contained in:
Florent Kermarrec 2017-07-19 12:18:35 +02:00
parent 20c859d45c
commit d05d170b75
1 changed files with 4 additions and 3 deletions

View File

@ -144,9 +144,10 @@ def get_csr_header(regions, constants, with_access_functions=True):
else: else:
value = str(value) value = str(value)
ctype = "int" ctype = "int"
r += "#define "+name+" "+value+"\n" r += "#define "+name+" "+value+"\n"
r += "static inline "+ctype+" "+name.lower()+"_read(void) {\n" if with_access_functions:
r += "\treturn "+value+";\n}\n" r += "static inline "+ctype+" "+name.lower()+"_read(void) {\n"
r += "\treturn "+value+";\n}\n"
r += "\n#endif\n" r += "\n#endif\n"
return r return r